texlive[54636] Build/source/libs: libgd 2.3.0

commits+kakuto at tug.org commits+kakuto at tug.org
Fri Apr 10 05:40:50 CEST 2020


Revision: 54636
          http://tug.org/svn/texlive?view=revision&revision=54636
Author:   kakuto
Date:     2020-04-10 05:40:48 +0200 (Fri, 10 Apr 2020)
Log Message:
-----------
libgd 2.3.0

Modified Paths:
--------------
    trunk/Build/source/libs/README
    trunk/Build/source/libs/gd/ChangeLog
    trunk/Build/source/libs/gd/README
    trunk/Build/source/libs/gd/TLpatches/ChangeLog
    trunk/Build/source/libs/gd/TLpatches/TL-Changes
    trunk/Build/source/libs/gd/TLpatches/patch-01-win32
    trunk/Build/source/libs/gd/TLpatches/patch-02-no-stdcall
    trunk/Build/source/libs/gd/configure
    trunk/Build/source/libs/gd/libgd-src/CHANGELOG.md
    trunk/Build/source/libs/gd/libgd-src/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/CONTRIBUTORS
    trunk/Build/source/libs/gd/libgd-src/COPYING
    trunk/Build/source/libs/gd/libgd-src/Makefile.am
    trunk/Build/source/libs/gd/libgd-src/README.md
    trunk/Build/source/libs/gd/libgd-src/VMS/CONFIGURE.COM
    trunk/Build/source/libs/gd/libgd-src/VMS/README.VMS
    trunk/Build/source/libs/gd/libgd-src/bootstrap.sh
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/AC_HEADER_STDC.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckDIRSymbolExists.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckPrototypeExists.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFontConfig.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindICONV.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindLIQ.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPTHREAD.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindWEBP.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindXPM.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.c
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/gd.cmake
    trunk/Build/source/libs/gd/libgd-src/config/Makefile.am
    trunk/Build/source/libs/gd/libgd-src/config/getver.pl
    trunk/Build/source/libs/gd/libgd-src/configure.ac
    trunk/Build/source/libs/gd/libgd-src/docs/INSTALL
    trunk/Build/source/libs/gd/libgd-src/docs/NEWS.historic
    trunk/Build/source/libs/gd/libgd-src/docs/README.CMAKE
    trunk/Build/source/libs/gd/libgd-src/docs/README.JPN
    trunk/Build/source/libs/gd/libgd-src/docs/README.TESTING
    trunk/Build/source/libs/gd/libgd-src/docs/README.TXT
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/nobgd.pl
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/preamble.txt
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Menu.txt
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/run_docs.sh
    trunk/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/examples/arc.c
    trunk/Build/source/libs/gd/libgd-src/examples/copyrotated.c
    trunk/Build/source/libs/gd/libgd-src/examples/crop.c
    trunk/Build/source/libs/gd/libgd-src/examples/flip.c
    trunk/Build/source/libs/gd/libgd-src/examples/gif.c
    trunk/Build/source/libs/gd/libgd-src/examples/nnquant.c
    trunk/Build/source/libs/gd/libgd-src/examples/resize.c
    trunk/Build/source/libs/gd/libgd-src/examples/tgaread.c
    trunk/Build/source/libs/gd/libgd-src/examples/tiffread.c
    trunk/Build/source/libs/gd/libgd-src/examples/windows.c
    trunk/Build/source/libs/gd/libgd-src/m4/ax_append_flag.m4
    trunk/Build/source/libs/gd/libgd-src/m4/ax_cflags_warn_all.m4
    trunk/Build/source/libs/gd/libgd-src/m4/ax_pthread.m4
    trunk/Build/source/libs/gd/libgd-src/m4/ax_require_defined.m4
    trunk/Build/source/libs/gd/libgd-src/src/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/src/COPYING
    trunk/Build/source/libs/gd/libgd-src/src/Makefile.am
    trunk/Build/source/libs/gd/libgd-src/src/annotate.c
    trunk/Build/source/libs/gd/libgd-src/src/bdftogd
    trunk/Build/source/libs/gd/libgd-src/src/bmp.h
    trunk/Build/source/libs/gd/libgd-src/src/circletexttest.c
    trunk/Build/source/libs/gd/libgd-src/src/config.h.cmake
    trunk/Build/source/libs/gd/libgd-src/src/config.hin
    trunk/Build/source/libs/gd/libgd-src/src/entities.html
    trunk/Build/source/libs/gd/libgd-src/src/fontconfigtest.c
    trunk/Build/source/libs/gd/libgd-src/src/fontsizetest.c
    trunk/Build/source/libs/gd/libgd-src/src/fontwheeltest.c
    trunk/Build/source/libs/gd/libgd-src/src/gd.c
    trunk/Build/source/libs/gd/libgd-src/src/gd.h
    trunk/Build/source/libs/gd/libgd-src/src/gd2copypal.c
    trunk/Build/source/libs/gd/libgd-src/src/gd2togif.c
    trunk/Build/source/libs/gd/libgd-src/src/gd2topng.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_bmp.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_color_match.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_crop.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_filename.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_filter.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_gd.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_gd2.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_gif_in.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_gif_out.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_intern.h
    trunk/Build/source/libs/gd/libgd-src/src/gd_interpolation.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_io.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_io.h
    trunk/Build/source/libs/gd/libgd-src/src/gd_io_dp.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx
    trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.h
    trunk/Build/source/libs/gd/libgd-src/src/gd_jpeg.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_matrix.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.h
    trunk/Build/source/libs/gd/libgd-src/src/gd_png.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_tga.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_tiff.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_topal.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_transform.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_wbmp.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_webp.c
    trunk/Build/source/libs/gd/libgd-src/src/gd_xbm.c
    trunk/Build/source/libs/gd/libgd-src/src/gdcache.c
    trunk/Build/source/libs/gd/libgd-src/src/gdcache.h
    trunk/Build/source/libs/gd/libgd-src/src/gdcmpgif.c
    trunk/Build/source/libs/gd/libgd-src/src/gddemo.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfontg.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfontl.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfontmb.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfontt.c
    trunk/Build/source/libs/gd/libgd-src/src/gdft.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfx.c
    trunk/Build/source/libs/gd/libgd-src/src/gdfx.h
    trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.c
    trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.h
    trunk/Build/source/libs/gd/libgd-src/src/gdkanji.c
    trunk/Build/source/libs/gd/libgd-src/src/gdparttopng.c
    trunk/Build/source/libs/gd/libgd-src/src/gdpp.cxx
    trunk/Build/source/libs/gd/libgd-src/src/gdpp.h
    trunk/Build/source/libs/gd/libgd-src/src/gdtables.c
    trunk/Build/source/libs/gd/libgd-src/src/gdtest.c
    trunk/Build/source/libs/gd/libgd-src/src/gdtestft.c
    trunk/Build/source/libs/gd/libgd-src/src/gdtopng.c
    trunk/Build/source/libs/gd/libgd-src/src/gifanimtest.c
    trunk/Build/source/libs/gd/libgd-src/src/giftogd2.c
    trunk/Build/source/libs/gd/libgd-src/src/jisx0208.h
    trunk/Build/source/libs/gd/libgd-src/src/msinttypes/inttypes.h
    trunk/Build/source/libs/gd/libgd-src/src/msinttypes/stdint.h
    trunk/Build/source/libs/gd/libgd-src/src/pngtogd.c
    trunk/Build/source/libs/gd/libgd-src/src/pngtogd2.c
    trunk/Build/source/libs/gd/libgd-src/src/testac.c
    trunk/Build/source/libs/gd/libgd-src/src/testtr.c
    trunk/Build/source/libs/gd/libgd-src/src/wbmp.c
    trunk/Build/source/libs/gd/libgd-src/src/wbmp.h
    trunk/Build/source/libs/gd/libgd-src/src/webpng.c
    trunk/Build/source/libs/gd/libgd-src/tests/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/Makefile.am
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00275.c
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00276.c
    trunk/Build/source/libs/gd/libgd-src/tests/freetype/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gd/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gd/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00209.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00354.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug_289.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/gd2_read.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/php_bug_72339.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagebrightness/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolor/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/gdimagecolorreplace.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecontrast/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/bug00340.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/gdnametest.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_1.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_2.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_3.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00104_1.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/github_bug_00238.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledpolygon/self_intersecting.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00004.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00078.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/bug00037.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilter/gdCopyBlurred.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageflip/gdimageflip.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/bug00386.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagenegate/basic.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagepixelate/gdimagepixelate.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/github_bug_00172.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/point_ordering.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00329.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00330.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug_overflow_large_new_size.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetpixel/alpha_blending.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/gdimagestringft_bbox.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/bug00307.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdinterpolatedscale/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.h
    trunk/Build/source/libs/gd/libgd-src/tests/gdtiled/bug00032.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffineboundingbox/github_bug_00221.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gif/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00006.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00181.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00227.c
    trunk/Build/source/libs/gd/libgd-src/tests/jpeg/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/jpeg/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c
    trunk/Build/source/libs/gd/libgd-src/tests/png/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/png/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/png/bug00338.c
    trunk/Build/source/libs/gd/libgd-src/tests/png/png_resolution.c
    trunk/Build/source/libs/gd/libgd-src/tests/tiff/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/tiff/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_dpi.c
    trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_read_bw.c
    trunk/Build/source/libs/gd/libgd-src/tests/wbmp/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/wbmp/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/webp/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/webp/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_109.c
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_170.c
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/x10_basic_read.c
    trunk/Build/source/libs/gd/libgd-src/windows/Makefile.vc
    trunk/Build/source/libs/gd/libgd-src/windows/gentest.bat
    trunk/Build/source/libs/gd/libgd-src/windows/libgd.rc
    trunk/Build/source/libs/gd/libgd-src/windows/msys/Makefile
    trunk/Build/source/libs/gd/libgd-src/windows/msys/README.MSYS.md
    trunk/Build/source/libs/gd/libgd-src/windows/msys/run_tests.sh
    trunk/Build/source/libs/gd/libgd-src/windows/readme.md
    trunk/Build/source/libs/gd/libgd-src/windows/run_tests.bat
    trunk/Build/source/libs/gd/version.ac

Added Paths:
-----------
    trunk/Build/source/libs/gd/libgd-src/CONTRIBUTING.md
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindRAQM.cmake
    trunk/Build/source/libs/gd/libgd-src/config/gdlib.pc.cmake
    trunk/Build/source/libs/gd/libgd-src/src/getopt.c
    trunk/Build/source/libs/gd/libgd-src/src/snprintf.c
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp
    trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2part.c
    trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2partptr.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/style.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/gdImageColorClosestHWB.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/cve_2019_6977.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/gdimagecolormatch.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/gdimagecompare.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/bug00369.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00432.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_auto.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_threshold.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00486.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/github_bug_00584.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/CMakeLists.txt
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/Makemodule.am
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00583.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00585.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00586.c
    trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00596.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00499.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif
    trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.c
    trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif
    trunk/Build/source/libs/gd/libgd-src/tests/jpeg/jpeg_ptr_double_free.c
    trunk/Build/source/libs/gd/libgd-src/tests/webp/gdImageWebpEx.c
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.c
    trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.xbm
    trunk/Build/source/libs/gd/libgd-src/windows/Makefiletest.vc

Removed Paths:
-------------
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/CMakeParseArguments.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFreetype.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindJPEG.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPNG.cmake
    trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPackageHandleStandardArgs.cmake
    trunk/Build/source/libs/gd/libgd-src/config/gdlib-config.in
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/html/
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Data/
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Languages.txt
    trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Topics.txt
    trunk/Build/source/libs/gd/libgd-src/netware/

Modified: trunk/Build/source/libs/README
===================================================================
--- trunk/Build/source/libs/README	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/README	2020-04-10 03:40:48 UTC (rev 54636)
@@ -15,7 +15,7 @@
 freetype2 2.10.1 - checked 02jul19
   http://savannah.nongnu.org/download/freetype/
 
-gd 2.2.5 - checked 30aug17
+gd 2.3.0 - checked 10apr20
   https://github.com/libgd/libgd/releases
 
 gmp 6.2.0 - checked 20jan20

Modified: trunk/Build/source/libs/gd/ChangeLog
===================================================================
--- trunk/Build/source/libs/gd/ChangeLog	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/ChangeLog	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,3 +1,8 @@
+2020-04-10  Akira Kakuto  <kakuto at w32tex.org>
+
+	Import libgd-2.3.0.
+	* version.ac: Adapted.
+
 2017-08-30  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import libgd-2.2.5.

Modified: trunk/Build/source/libs/gd/README
===================================================================
--- trunk/Build/source/libs/gd/README	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/README	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-	Building libgd-2.2.5 as part of the TL tree
+	Building libgd-2.3.0 as part of the TL tree
 	=========================================
 
 This directory libs/gd/ uses a proxy Makefile.am to build the gd library
@@ -11,4 +11,4 @@
 =============================
 
 2013-06-26	Peter Breitenlohner <peb at mppmu.mpg.de>
-2017-08-30	Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+2020-04-10	Akira Kakuto <kakuto at w32tex.org>

Modified: trunk/Build/source/libs/gd/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/gd/TLpatches/ChangeLog	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/TLpatches/ChangeLog	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,3 +1,10 @@
+2020-04-10  Akira Kakuto  <kakuto at w32tex.org>
+
+	Import libgd-2.3.0 source tree from:
+	  https://github.com/libgd/libgd/releases
+	* patch-01-win32: Adapted.
+	* patch-02-no-stdcall: Adapted.
+
 2017-08-30  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import libgd-2.2.5 source tree from:

Modified: trunk/Build/source/libs/gd/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/libs/gd/TLpatches/TL-Changes	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/TLpatches/TL-Changes	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-Changes applied to the libgd-2.2.5/ tree as obtained from:
+Changes applied to the libgd-2.3.0/ tree as obtained from:
 	https://github.com/libgd/libgd/releases
 
 Removed:

Modified: trunk/Build/source/libs/gd/TLpatches/patch-01-win32
===================================================================
--- trunk/Build/source/libs/gd/TLpatches/patch-01-win32	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/TLpatches/patch-01-win32	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,17 +1,65 @@
-diff -ur libgd-2.2.5.orig/src/gdft.c libgd-2.2.5/src/gdft.c
---- libgd-2.2.5.orig/src/gdft.c	Wed Aug 30 20:05:55 2017
-+++ libgd-2.2.5/src/gdft.c	Thu Aug 31 07:35:10 2017
-@@ -1683,6 +1683,16 @@
+diff -ur libgd-2.3.0/src/gd_interpolation.c libgd-src/src/gd_interpolation.c
+--- libgd-2.3.0/src/gd_interpolation.c	Sun Mar 22 22:42:38 2020
++++ libgd-src/src/gd_interpolation.c	Mon Mar 30 07:00:26 2020
+@@ -1988,19 +1988,19 @@
+ static int getPixelRgbInterpolated(gdImagePtr im, const int tcolor)
+ {
+ 	unsigned char r, g, b, a;
+-	int ct;
++	int ct, i;
+ 
+ 	b = (unsigned char)tcolor;
+-	g = (unsigned char)tcolor >> 8;
+-	r = (unsigned char)tcolor >> 16;
+-	a = (unsigned char)tcolor >> 24;
++	g = (unsigned char)(tcolor >> 8);
++	r = (unsigned char)(tcolor >> 16);
++	a = (unsigned char)(tcolor >> 24);
+ 
+ 	b = CLAMP(b, 0, 255);
+ 	g = CLAMP(g, 0, 255);
+ 	r = CLAMP(r, 0, 255);
+ 	a = CLAMP(a, 0, 127);
+ 
+-	for (int i = 0; i < im->colorsTotal; i++) {
++	for (i = 0; i < im->colorsTotal; i++) {
+ 	    if (im->red[i] == r && im->green[i] == g && im->blue[i] == b && im->alpha[i] == a) {
+ 			return i;
+ 		}
+diff -ur libgd-2.3.0/src/gdft.c libgd-src/src/gdft.c
+--- libgd-2.3.0/src/gdft.c	Sun Mar 22 22:42:38 2020
++++ libgd-src/src/gdft.c	Mon Mar 30 07:01:24 2020
+@@ -1519,6 +1519,8 @@
+ 		}
+ 
+ 		if (render) {
++			FT_Pos pen_x;
++			FT_Pos pen_y;
+ 			FT_Activate_Size (platform_specific);
+ 
+ 			/* load glyph again into the slot (erase previous one)  - this time with scaling */
+@@ -1552,8 +1554,8 @@
+ 			bm = (FT_BitmapGlyph) image;
+ 			/* position rounded down to nearest pixel at current dpi
+ 			(the estimate was rounded up to next 1/METRIC_RES, so this should fit) */
+-			FT_Pos pen_x = penf.x + info[i].x_offset;
+-			FT_Pos pen_y = penf.y - info[i].y_offset;
++			pen_x = penf.x + info[i].x_offset;
++			pen_y = penf.y - info[i].y_offset;
+ 			gdft_draw_bitmap (tc_cache, im, fg, bm->bitmap,
+ 					  (int)(x + (pen_x * cos_a + pen_y * sin_a)*hdpi/(METRIC_RES*64) + bm->left),
+ 					  (int)(y - (pen_x * sin_a - pen_y * cos_a)*vdpi/(METRIC_RES*64) - bm->top));
+@@ -1787,6 +1789,16 @@
  	 */
  	*fontpath = NULL;
  	fontsearchpath = getenv ("GDFONTPATH");
 +#ifdef _WIN32
 +        if (!fontsearchpath) {
-+          char *ffptr = getenv ("SYSTEMROOT");
++          char *ffptr = getenv ("WINDIR");
 +          if (ffptr) {
-+            fontsearchpath = malloc (strlen(ffptr) + strlen("\\fonts") + 1);
++            fontsearchpath = malloc (strlen(ffptr) + strlen("\\Fonts") + 1);
 +            strcpy(fontsearchpath, ffptr);
-+            strcat(fontsearchpath, "\\fonts");
++            strcat(fontsearchpath, "\\Fonts");
 +          }
 +        }
 +#endif

Modified: trunk/Build/source/libs/gd/TLpatches/patch-02-no-stdcall
===================================================================
--- trunk/Build/source/libs/gd/TLpatches/patch-02-no-stdcall	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/TLpatches/patch-02-no-stdcall	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,6 @@
-diff -ur libgd-2.2.5.orig/src/gd.h libgd-2.2.5/src/gd.h
---- libgd-2.2.5.orig/src/gd.h	Wed Aug 30 20:05:54 2017
-+++ libgd-2.2.5/src/gd.h	Thu Aug 31 07:36:57 2017
+diff -ur libgd-2.3.0/src/gd.h libgd-src/src/gd.h
+--- libgd-2.3.0/src/gd.h	Sun Mar 22 22:42:41 2020
++++ libgd-src/src/gd.h	Mon Mar 30 07:02:16 2020
 @@ -63,7 +63,7 @@
  #   define BGD_EXPORT_DATA_PROT __declspec(dllimport)
  #  endif

Modified: trunk/Build/source/libs/gd/configure
===================================================================
--- trunk/Build/source/libs/gd/configure	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/configure	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gd (TeX Live) 2.2.5.
+# Generated by GNU Autoconf 2.69 for gd (TeX Live) 2.3.0.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='gd (TeX Live)'
 PACKAGE_TARNAME='gd--tex-live-'
-PACKAGE_VERSION='2.2.5'
-PACKAGE_STRING='gd (TeX Live) 2.2.5'
+PACKAGE_VERSION='2.3.0'
+PACKAGE_STRING='gd (TeX Live) 2.3.0'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1306,7 +1306,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gd (TeX Live) 2.2.5 to adapt to many kinds of systems.
+\`configure' configures gd (TeX Live) 2.3.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1376,7 +1376,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gd (TeX Live) 2.2.5:";;
+     short | recursive ) echo "Configuration of gd (TeX Live) 2.3.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1485,7 +1485,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gd (TeX Live) configure 2.2.5
+gd (TeX Live) configure 2.3.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1908,7 +1908,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gd (TeX Live) $as_me 2.2.5, which was
+It was created by gd (TeX Live) $as_me 2.3.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3832,7 +3832,7 @@
 
 # Define the identity of the package.
  PACKAGE='gd--tex-live-'
- VERSION='2.2.5'
+ VERSION='2.3.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6671,7 +6671,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gd (TeX Live) $as_me 2.2.5, which was
+This file was extended by gd (TeX Live) $as_me 2.3.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6737,7 +6737,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gd (TeX Live) config.status 2.2.5
+gd (TeX Live) config.status 2.3.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/libs/gd/libgd-src/CHANGELOG.md
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/CHANGELOG.md	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/CHANGELOG.md	2020-04-10 03:40:48 UTC (rev 54636)
@@ -4,6 +4,57 @@
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## [2.3.0] - 2020-03-22
+
+### Security
+
+- Potential double-free in gdImage*Ptr(). (CVE-2019-6978)
+- gdImageColorMatch() out of bounds write on heap. (CVE-2019-6977)
+- Uninitialized read in gdImageCreateFromXbm(). (CVE-2019-11038)
+- Double-free in gdImageBmp. (CVE-2018-1000222)
+- Potential NULL pointer dereference in gdImageClone(). (CVE-2018-14553)
+- Potential infinite loop in gdImageCreateFromGifCtx(). (CVE-2018-5711)
+
+### Fixed
+
+* Fix #597: add codecov support
+
+- Fix #596: gdTransformAffineCopy run error
+
+- Fix #589: Install dependencies move to .travis.yml
+
+- Fix #586: gdTransformAffineCopy() segfaults on palette images
+- Fix #585: gdTransformAffineCopy() changes interpolation method
+- Fix #584: gdImageSetInterpolationMethod(im, GD_DEFAULT) inconsistent
+- Fix #583: gdTransformAffineCopy() may use unitialized values
+- Fix #533: Remove cmake modules
+- Fix #539: Add RAQM support for cmake
+- Fix #499: gdImageGifAnimAddPtr: heap corruption with 2 identical images
+- Fix #486: gdImageCropAuto(…, GD_CROP_SIDES) crops left but not right
+- Fix #485: auto cropping has insufficient precision
+- Fix #479: Provide a suitable malloc function to liq
+- Fix #474: libtiff link returns 404 HTTP code
+- Fix #450: Failed to open 1 bit per pixel bitmap
+- Fix #440: new_width & new_height exception handling
+- Fix #432: gdImageCrop neglecting transparency
+- Fix #420: Potential infinite loop in gdImageCreateFromGifCtx
+- Fix #411: gd_gd.c format documentation appears to be incorrect
+- Fix #369: Fix new_a init error in gdImageConvolution()
+- Fix #351: gdImageFilledArc() doesn't properly draw pies
+- Fix #338: Fatal and normal libjpeg/libpng errors not distinguishable
+- Fix #169: Update var type to hold bigger w&h for ellipse
+- Fix #164: update doc files install directory in CMakeLists.txt
+- Correct some test depend errors
+- Update cmake min version to 3.7
+- Delete libimagequant source code download action in CMakeLists.txt
+- Improve msys support
+- Fix some logic error in CMakeLists.txt
+- Remove the following macro: HAVE_STDLIB_H, HAVE_STRING_H, HAVE_STDDEF_H, HAVE_LIMITS_H, HAVE_ERRNO_H, AC_C_CONST
+
+### Added
+
+- test cases for following API: gdImageCopyResized(), gdImageWebpEx(), gdImageCreateFromGd2PartPtr(),  gdImageCloneMatch(), gdImageColorClosestHWB(), gdImageColorMatch(), gdImageStringUp(), gdImageStringUp16(), gdImageString(), gdImageString16(), gdImageCopyMergeGray(), gdImageCopyMerge()
+
 ## [2.2.5] - 2017-08-30
 
 ### Security

Modified: trunk/Build/source/libs/gd/libgd-src/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,10 +1,8 @@
-# $Id$
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR)
 
 SET(PACKAGE GD)
 SET(PACKAGE_NAME GD)
 
-CMAKE_POLICY(SET CMP0017 OLD)
 PROJECT(GD)
 
 SET(CMAKE_MODULE_PATH "${GD_SOURCE_DIR}/cmake/modules")
@@ -11,6 +9,7 @@
 
 include(gd)
 
+OPTION(ENABLE_GD_FORMATS "Enable GD image formats" 0)
 OPTION(ENABLE_PNG "Enable PNG support" 0)
 OPTION(ENABLE_LIQ "Enable libimagequant support" 0)
 OPTION(ENABLE_JPEG "Enable JPEG support" 0)
@@ -20,6 +19,7 @@
 OPTION(ENABLE_FREETYPE "Enable Freetype2 support" 0)
 OPTION(ENABLE_FONTCONFIG "Enable FontConfig support" 0)
 OPTION(ENABLE_WEBP "Enable WebP support" 0)
+OPTION(ENABLE_RAQM "Enable RAQM support" 0)
 
 if (BUILD_TEST)
 	ENABLE_TESTING()
@@ -31,24 +31,24 @@
 IF(CMAKE_COMPILER_IS_GNUCC)
   SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -O0") # will be added to CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
 ENDIF(CMAKE_COMPILER_IS_GNUCC)
-SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY 
-  ${PROJECT_BINARY_DIR}/Bin 
-  CACHE PATH 
-  "Single Directory for all Libraries" 
+SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
+  ${PROJECT_BINARY_DIR}/Bin
+  CACHE PATH
+  "Single Directory for all Libraries"
   )
 
-# --------- Setup the Executable output Directory ------------- 
-SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY 
-  ${PROJECT_BINARY_DIR}/Bin 
-  CACHE PATH 
-  "Single Directory for all Executables." 
+# --------- Setup the Executable output Directory -------------
+SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
+  ${PROJECT_BINARY_DIR}/Bin
+  CACHE PATH
+  "Single Directory for all Executables."
   )
 
-# --------- Setup the Executable output Directory ------------- 
-SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY 
-  ${PROJECT_BINARY_DIR}/Bin 
-  CACHE PATH 
-  "Single Directory for all static libraries." 
+# --------- Setup the Executable output Directory -------------
+SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+  ${PROJECT_BINARY_DIR}/Bin
+  CACHE PATH
+  "Single Directory for all static libraries."
   )
 
 if (USE_EXT_GD)
@@ -69,15 +69,31 @@
 	endif (GD_FOUND)
 else (USE_EXT_GD)
 
-	SET(GD_VERSION_MAJOR "2")
-	SET(GD_VERSION_MINOR "2")
-	SET(GD_VERSION_PATCH "5")
-	SET(GD_VERSION_EXTRA "")
-	SET(GD_VERSION "${GD_VERSION_MAJOR}.${GD_VERSION_MINOR}.${GD_VERSION_PATCH}${GD_VERSION_EXTRA}")
-	SET(GD_VERSION_STRING "${GD_VERSION}")
+	MACRO(GV VER VAR)
+		execute_process(
+			COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/config/getver.pl ${VER}
+			OUTPUT_VARIABLE ${VAR}
+		)
+	ENDMACRO(GV)
 
-	SET(GD_VERSION_INT "2020555")
+	GV(MAJOR GDLIB_MAJOR)
+	GV(MINOR GDLIB_MINOR)
+	GV(RELEASE GDLIB_REVISION)
+	GV(EXTRA GDLIB_EXTRA)
+	SET(GDLIB_VERSION "${GDLIB_MAJOR}.${GDLIB_MINOR}.${GDLIB_REVISION}${GDLIB_EXTRA}")
+	MESSAGE(STATUS "gd version ${GDLIB_VERSION}")
 
+	MACRO(GV_LT VER VAR)
+		execute_process(
+			COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/config/getlib.sh ${VER}
+			OUTPUT_VARIABLE ${VAR}
+		)
+	ENDMACRO(GV_LT)
+
+	GV_LT(SONAME GDLIB_LIB_SOVERSION)
+	GV_LT(VERSION GDLIB_LIB_VERSION)
+	MESSAGE(STATUS "gd shared lib version ${GDLIB_LIB_SOVERSION} (${GDLIB_LIB_VERSION})")
+
 	SET(CMAKE_REQUIRED_INCLUDES "/usr/include" "/usr/local/include")
 
 	include(CheckIncludeFiles)
@@ -89,7 +105,7 @@
 	if (ENABLE_PNG)
 		FIND_PACKAGE(PNG REQUIRED)
 	endif (ENABLE_PNG)
-	
+
 	if (ENABLE_ICONV)
 		FIND_PACKAGE(ICONV REQUIRED)
 	endif (ENABLE_ICONV)
@@ -128,6 +144,12 @@
 		FIND_PACKAGE(FontConfig)
 	endif (ENABLE_FONTCONFIG)
 
+	if (ENABLE_RAQM)
+		FIND_PACKAGE(RAQM)
+	endif (ENABLE_RAQM)
+
+	SET(ENABLE_GD_FORMATS ${ENABLE_GD_FORMATS})
+
 	if (FREETYPE_FOUND)
 		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
 		SET(HAVE_FT2BUILD_H 1)
@@ -148,7 +170,7 @@
 		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
 		SET(HAVE_LIBPNG 1)
 	ENDIF(PNG_FOUND)
-	
+
 	IF(ICONV_FOUND)
 		INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
 		SET(HAVE_ICONV 1)
@@ -184,6 +206,10 @@
 		SET(FONTCONFIG_LIB_DIR "")
 	ENDIF(FONTCONFIG_FOUND)
 
+	IF(RAQM_FOUND)
+		INCLUDE_DIRECTORIES(${RAQM_INCLUDE_DIR})
+	ENDIF(RAQM_FOUND)
+
 	SET(HAVE_CONFIG_H 1)
 
 	ADD_DEFINITIONS(-DHAVE_CONFIG_H)
@@ -230,10 +256,10 @@
 
 SET(CPACK_PACKAGE_NAME "libgd")
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libGD, powerful and easy to use graphic library")
-SET(CPACK_PACKAGE_VENDOR "http://www.libgd.org")
-SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "2")
-SET(CPACK_PACKAGE_VERSION_PATCH "5")
+SET(CPACK_PACKAGE_VENDOR "https://www.libgd.org")
+SET(CPACK_PACKAGE_VERSION_MAJOR ${GDLIB_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${GDLIB_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${GDLIB_REVISION}${GDLIB_EXTRA})
 
 if(WIN32)
 	set(CPACK_GENERATOR ZIP)
@@ -241,35 +267,30 @@
 	set(CPACK_GENERATOR TGZ)
 endif(WIN32)
 
-IF (ENABLE_LIQ AND LIQ_BUILD)
-    ADD_DEPENDENCIES(${GD_LIB} libimagequant)
-    ADD_DEPENDENCIES(${GD_LIB_STATIC} libimagequant)
-ENDIF(ENABLE_LIQ AND LIQ_BUILD)
 
+INSTALL(FILES docs/INSTALL DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES docs/README.JPN DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES docs/README.CMAKE DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES docs/README.TESTING DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES docs/README.TXT DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
 
-INSTALL(FILES docs/INSTALL DESTINATION share/docs)
-INSTALL(FILES docs/README.JPN DESTINATION share/docs)
-INSTALL(FILES docs/README.CMAKE DESTINATION share/docs)
-INSTALL(FILES docs/README.TESTING DESTINATION share/docs)
-INSTALL(FILES docs/README.TXT DESTINATION share/docs)
 
+INSTALL(FILES examples/arc.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/copyrotated.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/crop.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/flip.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/gif.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/nnquant.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/noIcon.pic DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/noIcon.sgi DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/noIcon.tga DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/noIconAlpha.tga DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/test_crop_threshold.png DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/tgaread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/tiffread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
+INSTALL(FILES examples/windows.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
 
-INSTALL(FILES examples/arc.c DESTINATION share/docs)
-INSTALL(FILES examples/copyrotated.c DESTINATION share/docs)
-INSTALL(FILES examples/crop.c DESTINATION share/docs)
-INSTALL(FILES examples/flip.c DESTINATION share/docs)
-INSTALL(FILES examples/gif.c DESTINATION share/docs)
-INSTALL(FILES examples/nnquant.c DESTINATION share/docs)
-INSTALL(FILES examples/noIcon.pic DESTINATION share/docs)
-INSTALL(FILES examples/noIcon.sgi DESTINATION share/docs)
-INSTALL(FILES examples/noIcon.tga DESTINATION share/docs)
-INSTALL(FILES examples/noIconAlpha.tga DESTINATION share/docs)
-INSTALL(FILES examples/test_crop_threshold.png DESTINATION share/docs)
-INSTALL(FILES examples/tgaread.c DESTINATION share/docs)
-INSTALL(FILES examples/tiffread.c DESTINATION share/docs)
-INSTALL(FILES examples/windows.c DESTINATION share/docs)
 
-
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
 
 set(CPACK_SOURCE_GENERATOR TGZ)
@@ -283,4 +304,3 @@
 )
 install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR})
 INCLUDE(CPack)
-

Added: trunk/Build/source/libs/gd/libgd-src/CONTRIBUTING.md
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/CONTRIBUTING.md	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/CONTRIBUTING.md	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,138 @@
+# Contributing to libgd
+
+:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
+
+#### Table Of Contents
+
+[What should I know before I get started?](#what-should-i-know-before-i-get-started)
+  * [Code of Conduct](#code-of-conduct)
+  * [Repositories](#Repositories)
+
+[How Can I Contribute?](#how-can-i-contribute)
+  * [Reporting Bugs](#reporting-bugs)
+  * [Suggesting Enhancements](#suggesting-enhancements)
+  * [Your First Code Contribution](#your-first-code-contribution)
+  * [Pull Requests](#pull-requests)
+
+[Styleguides](#styleguides)
+  * [Git Commit Messages](#git-commit-messages)
+  * [Coding standard](#coding-standard)
+  * [Documentation Styleguide](#documentation-styleguide)
+
+## What should I know before I get started?
+
+### Code of Conduct
+
+This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
+By participating, you are expected to uphold this code.
+Please report unacceptable behavior to [security at libg.org](mailto:security at libgd.org).
+
+### Repositories
+
+* [The main libGD repository](https://github.com/libgd/libgd) for the library and utilities released as part of libgd
+* [The libgd website repository](https://github.com/libgd/website) for the libgd.org website
+* [The Pango support for libgd repository](https://github.com/libgd/gd-pango) for the for libGD Pango support
+
+
+## How Can I Contribute?
+
+### Reporting Bugs
+
+This section guides you through submitting a bug report for Atom. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
+
+Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). If you'd like, you can use [this template](#template-for-submitting-bug-reports) to structure the information.
+
+#### Before Submitting A Bug Report
+
+* **Determine [which repository the problem should be reported in](#atom-and-packages)**.
+* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Alibgd)** to see if the problem has already been reported. If it has, add a comment to the existing issue instead of opening a new one.
+
+#### How Do I Submit A (Good) Bug Report?
+
+For security related bugs, github does not support private issues, that's why we have to handle security issues outside the issues tracker for now. Please drop a mail to [security at libg.org](mailto:security at libgd.org).
+
+Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#repositories) your bug is related to, create an issue on that repository and provide the following information.
+
+Explain the problem and include additional details to help maintainers reproduce the problem:
+
+* **Use a clear and descriptive title** for the issue to identify the problem.
+* **Describe the exact steps which reproduce the problem** in as many details as possible.
+* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable workable example (for example see [this simple test case](https://github.com/libgd/libgd/blob/master/tests/gd/gd_null.c), which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
+* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
+* **Explain which behavior you expected to see instead and why.**
+* **Include images, expected and result images** which show you following the described steps and clearly demonstrate the problem.
+* **If you're reporting that libGD crashed**, include a crash report with a stack trace from the operating system. Include the crash report in the issue in a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines), a [file attachment](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), or put it in a [gist](https://gist.github.com/) and provide link to that gist.
+
+
+This text has been largely inspired by the Atom contributing notes, which are amazingly complete.
+
+
+## Styleguides
+
+These sections tend to bore people. But if you don't follow them, it slows
+down reviews from developers (and tends to tire/annoy them). Please give it
+a look over and feel free to ask questions.
+
+### Git Commit Messages
+
+Rather than duplicate a ton of great explanations, please read this site:
+http://chris.beams.io/posts/git-commit/
+
+Yes, it's long, but once you read and understand it once, it applies to
+every git project out there, not just GD.
+
+In case that site is broken, here is an archived link:
+http://web.archive.org/web/20160706012209/http://chris.beams.io/posts/git-commit/
+
+### Coding standard
+
+#### Style
+
+First, coding style should be consistent. If you're modifying a file that
+might not follow this section, stick with that file's style. If we want to
+fix the style later, we can.
+
+As for the rest, TBD!
+
+#### Practices
+
+Check for invalid settings (where reasonable) and return an error directly.
+Do not use `assert` and do not require the user to follow the documented API.
+e.g. Check for `NULL` pointers, and check enum values are within range. The
+GD library is used in a lot of hostile environments (like websites) and is
+given hostile (user controlled) data. When GD mishandles memory, that can be
+used to attack servers. When GD crashes (or calls `assert`), that can take
+out a web session.
+
+#### Testing
+
+We love unit tests. Every bugfix, new API, etc... should include a test update
+to make sure future work doesn't break things or regress. We want to fix bugs
+just once, not over and over again.
+
+Note that we say "should". While we really like tests, we understand that not
+all changes are trivial to verify.
+
+Some general guidelines:
+
+* Tests should be standalone: One test should test one thing only.
+* Tests should be reproducible: Avoid relying on system settings like /etc.
+* Tests must be fast: A good guideline is that they should take <1 second,
+  and must take <5 seconds.
+* Tests must be documented: Just add a comment block to the top of the file
+  with a short description and any existing bugs/URLs.
+
+### Documentation Styleguide
+
+Do everything in markdown. It's readable even in plain text, and converts
+well into other formats (e.g. HTML). The question is which flavor!
+
+For files that end in `.md`, use
+[GitHub markdown](https://guides.github.com/features/mastering-markdown/).
+
+For API documentation (embedded in the code), we use
+[Natural Docs](http://www.naturaldocs.org/). You can find more info about
+it under the [docs/naturaldocs/](docs/naturaldocs/) subdirectory.
+
+Try to keep the file linewrapped to 80 cols. Sometimes you won't be able to
+because of long strings (like links), and that's OK.

Modified: trunk/Build/source/libs/gd/libgd-src/CONTRIBUTORS
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/CONTRIBUTORS	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/CONTRIBUTORS	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,7 @@
 chapg
+Chen Pingping (Wilson)
 Chris Reuter
+Christoph M. Becker
 Colin Watson
 Dimitar Dobrev
 edink
@@ -11,7 +13,7 @@
 Marcin Wojdyr
 mattias
 Mike Frysinger
-mloskot
+Mateusz Loskot (mloskot)
 Nathanael Jones
 nlopess
 Ondřej Surý

Modified: trunk/Build/source/libs/gd/libgd-src/COPYING
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/COPYING	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/COPYING	2020-04-10 03:40:48 UTC (rev 54636)
@@ -70,4 +70,3 @@
 Although their code does not appear in the current release, the
 authors wish to thank David Koblas, David Rowley, and Hutchison
 Avenue Software Corporation for their prior contributions.
-

Modified: trunk/Build/source/libs/gd/libgd-src/Makefile.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/Makefile.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/Makefile.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = src config tests
-EXTRA_DIST = test docs examples windows VMS cmake netware bootstrap.sh CMakeLists.txt CONTRIBUTORS README.md CHANGELOG.md
+EXTRA_DIST = test docs examples windows VMS cmake bootstrap.sh CMakeLists.txt CONTRIBUTORS README.md CHANGELOG.md CONTRIBUTING.md
 
 clean-local:
 	$(srcdir)/cmake/distclean.sh --automake

Modified: trunk/Build/source/libs/gd/libgd-src/README.md
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/README.md	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/README.md	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,6 +2,8 @@
 
 [![Build Status](https://travis-ci.org/libgd/libgd.svg?branch=master)](https://travis-ci.org/libgd/libgd)
 [![Build Status](https://scan.coverity.com/projects/3810/badge.svg)](https://scan.coverity.com/projects/libgd)
+[![Chat](https://badges.gitter.im/libgd/libgd.svg)](https://gitter.im/libgd/libgd)
+[![codecov.io](https://codecov.io/github/libgd/libgd/coverage.svg?branch=master)](https://codecov.io/github/libgd/libgd/)
 
 GD is an open source code library for the dynamic creation of images by
 programmers.
@@ -18,6 +20,10 @@
 by many contributors (see the [CONTRIBUTORS](CONTRIBUTORS) file) under the
 umbrella of PHP.net.
 
+If you like to contribute, report bugs, see [how to contribute document](CONTRIBUTING.md)
+
+For security related issues, please contact us at security at libgd.org
+
 ## Downloads/etc...
 
 Please visit our [homepage](http://www.libgd.org/) for more details.
@@ -36,6 +42,6 @@
 * [JPEG](https://en.wikipedia.org/wiki/JPEG) via [IJG/libjpeg](http://www.ijg.org/) or [libjpeg-turbo](http://libjpeg-turbo.virtualgl.org/)
   * Does not include [JPEG 2000](https://en.wikipedia.org/wiki/JPEG_2000)
 * [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) via [libpng](http://www.libpng.org/)
-* [TIFF](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) via [libtiff](http://www.remotesensing.org/libtiff/)
+* [TIFF](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) via [libtiff](http://www.libtiff.org/)
 * [WebP](https://en.wikipedia.org/wiki/WebP) via [libwebp](https://developers.google.com/speed/webp/)
 * [XPM](https://en.wikipedia.org/wiki/X_PixMap) via [libXpm](http://xorg.freedesktop.org/)

Modified: trunk/Build/source/libs/gd/libgd-src/VMS/CONFIGURE.COM
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/VMS/CONFIGURE.COM	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/VMS/CONFIGURE.COM	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,6 @@
 $! (c) Alexey Chupahin  18-APR-2006, 15-DEC-2007
 $! OpenVMS 8.2  Alpha DEC 2000 model 300
-$! OpenVMS 8.3  Itanium rx1620 
+$! OpenVMS 8.3  Itanium rx1620
 $! GNU
 $!
 $!
@@ -26,9 +26,9 @@
 $ENDIF
 $DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
 $IF (DECC) THEN $WRITE SYS$OUTPUT  "Compiler		...  DEC C"
-$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT  "BAD compiler" GOTO EXIT 
+$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT  "BAD compiler" GOTO EXIT
 $MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
-$MMK = F$TYPE(MMK) 
+$MMK = F$TYPE(MMK)
 $IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES
 $WRITE SYS$OUTPUT "Please install MMS from DECSET or MMK"
 $! I cant find any make tool
@@ -150,7 +150,7 @@
 int main(int argc, char *argv[])
 {
 
-#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR <= 1 
+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR <= 1
         printf("This version is too old. Please get newest\n");
         printf("From fafner.dyndns.org/~alexey/libsdl/required.html\n");
 	exit(2);
@@ -220,8 +220,8 @@
 	 n=png_access_version_number();
 	 n3=n%100; n=n/100;
 	 n2=n%100; n=n/100;
-	 n1=n%100; 
-	if ( (n1<=1)&&(n2<2) ) 
+	 n1=n%100;
+	if ( (n1<=1)&&(n2<2) )
 		{ printf("checking version  libPNG:  %d.%d.%d\n",n1,n2,n3);
 		  printf("This version is too old. Please get newest\n");
 		  printf("From fafner.dyndns.org/~alexey/libsdl/public.html\n");
@@ -252,7 +252,7 @@
 $       	HAVE_LIBPNG=0
 $       	GOTO NEXT2
 $	 ELSE
-$		HAVE_LIBPNG=1 
+$		HAVE_LIBPNG=1
 $		LIBPNG_STATIC=1
 $       ENDIF
 $  ELSE
@@ -287,7 +287,7 @@
       #include <stdlib.h>
       #include <stdio.h>
       #include <jpeglib.h>
-      #include <jversion.h>	
+      #include <jversion.h>
    int main()
      {
 	printf("checking version jpeg:  %s\n",JVERSION);
@@ -805,7 +805,7 @@
 $	IF (ZLIB_STATIC.EQ.0)
 $	  THEN
 $		APP SYS$INPUT [.SRC]LIBGD.OPT
-		SYS$SHARE:LIBZSHR/SHARE	
+		SYS$SHARE:LIBZSHR/SHARE
 $	  ELSE
 $		APP SYS$INPUT [.SRC]LIBGD.OPT
 		ZLIB:LIBZ/LIB
@@ -857,11 +857,6 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
 
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
@@ -894,12 +889,6 @@
 /* Define to 1 if you have the <libpng/png.h> header file. */
 /* #undef HAVE_LIBPNG_PNG_H */
 
-
-
-/* Define to 1 if you have the <limits.h> header file. */
-//#define HAVE_LIMITS_H 1
-
-
 /* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
 
@@ -907,21 +896,12 @@
 /* Define if you have POSIX threads libraries and header files. */
 #define HAVE_PTHREAD 1
 
-/* Define to 1 if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 //#define HAVE_STDINT_H 1
 
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
 /* Define to 1 if you have the <strings.h> header file. */
 #define HAVE_STRINGS_H 1
 
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
 
@@ -954,29 +934,29 @@
 	/* Define if <iconv.h> defines iconv_t. */
 	#define HAVE_ICONV_T_DEF 1
 $ENDIF
-$IF HAVE_TIFF.EQ.1 
-$  THEN 
+$IF HAVE_TIFF.EQ.1
+$  THEN
 $	APP SYS$INPUT [.SRC]CONFIG.H
 	#define HAVE_LIBTIFF 1
 $ENDIF
-$IF HAVE_LIBPNG.EQ.1   
-$   THEN 
+$IF HAVE_LIBPNG.EQ.1
+$   THEN
 $	APP SYS$INPUT [.SRC]CONFIG.H
 	#define HAVE_LIBPNG 1
 $ENDIF
 $IF HAVE_FREETYPE.EQ.1
-$   THEN 
+$   THEN
 $	APP SYS$INPUT [.SRC]CONFIG.H
 	#define HAVE_LIBFREETYPE 1
 	#define HAVE_FT2BUILD_H 1
 $ENDIF
-$IF HAVE_JPEG.EQ.1 
-$   THEN 
+$IF HAVE_JPEG.EQ.1
+$   THEN
 $	APP SYS$INPUT [.SRC]CONFIG.H
 	#define HAVE_LIBJPEG 1
 $ENDIF
-$IF HAVE_ZLIB.EQ.1 
-$   THEN 
+$IF HAVE_ZLIB.EQ.1
+$   THEN
 $	APP SYS$INPUT [.SRC]CONFIG.H
 	#define HAVE_LIBZ 1
 $ENDIF
@@ -994,8 +974,8 @@
 # Alexey Chupahin elvis_75 at mail.ru
 # OpenVMS 7.3-1,8.2  DEC 2000 mod.300
 # OpenVMS 8.3        HP  rx1620
-  
 
+
 .FIRST
 	DEF LIBGD []
 

Modified: trunk/Build/source/libs/gd/libgd-src/VMS/README.VMS
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/VMS/README.VMS	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/VMS/README.VMS	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,6 @@
 Dear OpenVMS user,
 
-Installation process is identical to one in *nix* world and consist to 
+Installation process is identical to one in *nix* world and consist to
 four simple steps:
 1. Installing required libraries
 2. Configuration
@@ -18,7 +18,7 @@
 All may be found at OpenVMS libSDL porting project site
 http://fafner.dyndns.org/~alexey/libsdl/required.html
 
-Also, system should have MMS make utility from DEC or 
+Also, system should have MMS make utility from DEC or
 free analogue MMK. And C compiler with runtime, of course. ;)
 
 
@@ -27,14 +27,14 @@
 $@[.VMS]CONFIGURE
 
 The script detects hardware,system and required libraries have been installed.
-Compilation stage will be prepeared to create shared and static libraries. 
-Alpha,IA64 or VAX platform are supported. Optional argument "static" 
+Compilation stage will be prepeared to create shared and static libraries.
+Alpha,IA64 or VAX platform are supported. Optional argument "static"
 tells to configurator to make static libraries only:
 
 $@[.VMS]CONFIGURE STATIC
 
-CONFIGURE script checks your ZLIB, FREETYPE, JPEG, PNG libraries. 
-If it detects any troubles, you may get and install good and tested ones 
+CONFIGURE script checks your ZLIB, FREETYPE, JPEG, PNG libraries.
+If it detects any troubles, you may get and install good and tested ones
 from OpenVMS libSDL porting project site:
 http://fafner.dyndns.org/~alexey/libsdl/required.html
 
@@ -54,7 +54,7 @@
 
 LIBGD and its utilites are ready to using.
 
-Optionally you may insert this startup file into your LOGIN.COM 
+Optionally you may insert this startup file into your LOGIN.COM
 to set libGD environment every time you login automatically.
 
 To learn libGD please refer libGD official documentation.

Modified: trunk/Build/source/libs/gd/libgd-src/bootstrap.sh
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/bootstrap.sh	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/bootstrap.sh	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 #!/bin/sh --
-# $Id$
 # Small shell script to build gd from source
 
 v() { echo "$@"; "$@"; }
@@ -11,7 +10,7 @@
 v docs/naturaldocs/run_docs.sh --nonfatal
 
 if echo "${OSTYPE:-$(uname)}" | grep -q '^darwin' ; then
-	echo "Having trouble on OS X? Try: brew install autoconf libtool automake gettext apple-gcc42 pkg-config cmake"
+	echo "Having trouble on OS X? Try: brew install autoconf libtool automake gettext pkg-config cmake"
 fi
 
 if ! v autoreconf -f -i ; then
@@ -20,8 +19,9 @@
 
 (
 echo "/* Generated from config.hin via autoheader for cmake; see bootstrap.sh. */"
-sed \
+sed -E \
 	-e '1d' \
+	-e '/ENABLE_/{s:#undef:#define:;s:([^ ]*)$:\1 @\1@:;}' \
 	-e 's:#undef:#cmakedefine:' \
 	src/config.hin
 ) > src/config.h.cmake

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/AC_HEADER_STDC.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/AC_HEADER_STDC.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/AC_HEADER_STDC.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,13 +1,8 @@
 # Keep in sync with AC_CHECK_HEADERS in configure.ac.
 
 check_include_files(dirent.h HAVE_DIRENT_H)
-check_include_files(errno.h HAVE_ERRNO_H)
 check_include_files(inttypes.h HAVE_INTTYPES_H)
-check_include_files(limits.h HAVE_LIMITS_H)
-check_include_files(stddef.h HAVE_STDDEF_H)
 check_include_files(stdint.h HAVE_STDINT_H)
-check_include_files(stdlib.h HAVE_STDLIB_H)
-check_include_files(string.h HAVE_STRING_H)
 check_include_files(strings.h HAVE_STRINGS_H)
 check_include_files(unistd.h HAVE_UNISTD_H)
 

Deleted: trunk/Build/source/libs/gd/libgd-src/cmake/modules/CMakeParseArguments.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/CMakeParseArguments.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/CMakeParseArguments.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,156 +0,0 @@
-# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
-#
-# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
-# parsing the arguments given to that macro or function.
-# It processes the arguments and defines a set of variables which hold the
-# values of the respective options.
-#
-# The <options> argument contains all options for the respective macro,
-# i.e. keywords which can be used when calling the macro without any value
-# following, like e.g. the OPTIONAL keyword of the install() command.
-#
-# The <one_value_keywords> argument contains all keywords for this macro
-# which are followed by one value, like e.g. DESTINATION keyword of the
-# install() command.
-#
-# The <multi_value_keywords> argument contains all keywords for this macro
-# which can be followed by more than one value, like e.g. the TARGETS or
-# FILES keywords of the install() command.
-#
-# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
-# keywords listed in <options>, <one_value_keywords> and
-# <multi_value_keywords> a variable composed of the given <prefix>
-# followed by "_" and the name of the respective keyword.
-# These variables will then hold the respective value from the argument list.
-# For the <options> keywords this will be TRUE or FALSE.
-#
-# All remaining arguments are collected in a variable
-# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
-# your macro was called with unrecognized parameters.
-#
-# As an example here a my_install() macro, which takes similar arguments as the
-# real install() command:
-#
-#   function(MY_INSTALL)
-#     set(options OPTIONAL FAST)
-#     set(oneValueArgs DESTINATION RENAME)
-#     set(multiValueArgs TARGETS CONFIGURATIONS)
-#     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-#     ...
-#
-# Assume my_install() has been called like this:
-#   my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
-#
-# After the cmake_parse_arguments() call the macro will have set the following
-# variables:
-#   MY_INSTALL_OPTIONAL = TRUE
-#   MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
-#   MY_INSTALL_DESTINATION = "bin"
-#   MY_INSTALL_RENAME = "" (was not used)
-#   MY_INSTALL_TARGETS = "foo;bar"
-#   MY_INSTALL_CONFIGURATIONS = "" (was not used)
-#   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
-#
-# You can the continue and process these variables.
-#
-# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
-# another recognized keyword follows, this is interpreted as the beginning of
-# the new option.
-# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
-# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
-# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
-
-#=============================================================================
-# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 
-#  * Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-# 
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-
-if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
-  return()
-endif()
-set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
-
-
-function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
-  # first set all result variables to empty/FALSE
-  foreach(arg_name ${_singleArgNames} ${_multiArgNames})
-    set(${prefix}_${arg_name})
-  endforeach()
-
-  foreach(option ${_optionNames})
-    set(${prefix}_${option} FALSE)
-  endforeach()
-
-  set(${prefix}_UNPARSED_ARGUMENTS)
-
-  set(insideValues FALSE)
-  set(currentArgName)
-
-  # now iterate over all arguments and fill the result variables
-  foreach(currentArg ${ARGN})
-    list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword
-    list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
-    list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
-
-    if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1)
-      if(insideValues)
-        if("${insideValues}" STREQUAL "SINGLE")
-          set(${prefix}_${currentArgName} ${currentArg})
-          set(insideValues FALSE)
-        elseif("${insideValues}" STREQUAL "MULTI")
-          list(APPEND ${prefix}_${currentArgName} ${currentArg})
-        endif()
-      else()
-        list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
-      endif()
-    else()
-      if(NOT ${optionIndex} EQUAL -1)
-        set(${prefix}_${currentArg} TRUE)
-        set(insideValues FALSE)
-      elseif(NOT ${singleArgIndex} EQUAL -1)
-        set(currentArgName ${currentArg})
-        set(${prefix}_${currentArgName})
-        set(insideValues "SINGLE")
-      elseif(NOT ${multiArgIndex} EQUAL -1)
-        set(currentArgName ${currentArg})
-        set(${prefix}_${currentArgName})
-        set(insideValues "MULTI")
-      endif()
-    endif()
-
-  endforeach()
-
-  # propagate the result variables to the caller:
-  foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
-    set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
-  endforeach()
-  set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
-
-endfunction()

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckDIRSymbolExists.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckDIRSymbolExists.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckDIRSymbolExists.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,16 +7,16 @@
 #
 #  * Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
-# 
+#
 #  * Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
-# 
+#
 #  * The names of Kitware, Inc., the Insight Consortium, or the names of
 #    any consortium members, or of any contributors, may not be used to
 #    endorse or promote products derived from this software without
 #    specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -39,7 +39,7 @@
 # the AC_HEADER_DIRENT test programme rather than the CheckSymbolExists.cmake
 # test programme which always fails since DIR tends to be typedef'd
 # rather than #define'd.
-# 
+#
 # The following variables may be set before calling this macro to
 # modify the way the check is run:
 #
@@ -53,7 +53,7 @@
     SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
     SET(MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
     IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_DIRSYMBOL_EXISTS_LIBS 
+      SET(CHECK_DIRSYMBOL_EXISTS_LIBS
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
     ELSE(CMAKE_REQUIRED_LIBRARIES)
       SET(CHECK_DIRSYMBOL_EXISTS_LIBS)
@@ -79,7 +79,7 @@
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS 
+      CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS}
       "${CHECK_DIRSYMBOL_EXISTS_LIBS}"
       "${CMAKE_DIRSYMBOL_EXISTS_INCLUDES}"
@@ -87,7 +87,7 @@
     IF(${VARIABLE})
       MESSAGE(STATUS "Looking for DIR in ${FILES} - found")
       SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol DIR")
-      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
         "Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
         "passed with the following output:\n"
         "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"
@@ -95,7 +95,7 @@
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for DIR in ${FILES} - not found.")
       SET(${VARIABLE} "" CACHE INTERNAL "Have symbol DIR")
-      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
         "Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
         "failed with the following output:\n"
         "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckPrototypeExists.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckPrototypeExists.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/CheckPrototypeExists.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,16 +7,16 @@
 #
 #  * Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
-# 
+#
 #  * Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
-# 
+#
 #  * The names of Kitware, Inc., the Insight Consortium, or the names of
 #    any consortium members, or of any contributors, may not be used to
 #    endorse or promote products derived from this software without
 #    specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -66,4 +66,3 @@
 ")
    CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
-

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFontConfig.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFontConfig.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFontConfig.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,17 +1,17 @@
 # Copyright (c) 2006,2007 Laurent Montel, <montel at kde.org>
-# 
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
-# 
+#
 # 1. Redistributions of source code must retain the copyright
 #    notice, this list of conditions and the following disclaimer.
 # 2. Redistributions in binary form must reproduce the copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products 
+# 3. The name of the author may not be used to endorse or promote products
 #    derived from this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

Deleted: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFreetype.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFreetype.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindFreetype.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,128 +0,0 @@
-# - Locate FreeType library
-# This module defines
-#  FREETYPE_LIBRARIES, the library to link against
-#  FREETYPE_FOUND, if false, do not try to link to FREETYPE
-#  FREETYPE_INCLUDE_DIRS, where to find headers.
-#  FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
-#  This is the concatenation of the paths:
-#  FREETYPE_INCLUDE_DIR_ft2build
-#  FREETYPE_INCLUDE_DIR_freetype2
-#
-# $FREETYPE_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$FREETYPE_DIR
-# used in building FREETYPE.
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 
-#  * Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-# 
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Created by Eric Wing.
-# Modifications by Alexander Neundorf.
-# This file has been renamed to "FindFreetype.cmake" instead of the correct
-# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
-
-# Ugh, FreeType seems to use some #include trickery which
-# makes this harder than it should be. It looks like they
-# put ft2build.h in a common/easier-to-find location which
-# then contains a #include to a more specific header in a
-# more specific location (#include <freetype/config/ftheader.h>).
-# Then from there, they need to set a bunch of #define's
-# so you can do something like:
-# #include FT_FREETYPE_H
-# Unfortunately, using CMake's mechanisms like include_directories()
-# wants explicit full paths and this trickery doesn't work too well.
-# I'm going to attempt to cut out the middleman and hope
-# everything still works.
-find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
-  HINTS
-    ENV FREETYPE_DIR
-  PATHS
-    /usr/local/X11R6
-    /usr/local/X11
-    /usr/freeware
-  PATH_SUFFIXES include/freetype2 include
-)
-
-find_path(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
-  HINTS
-    ENV FREETYPE_DIR
-  PATHS
-    /usr/local/X11R6
-    /usr/local/X11
-    /usr/freeware
-  PATH_SUFFIXES include/freetype2 include
-)
-
-find_library(FREETYPE_LIBRARY
-  NAMES freetype libfreetype freetype219 freetype_a
-  HINTS
-    ENV FREETYPE_DIR
-  PATH_SUFFIXES lib
-  PATHS
-  /usr/local/X11R6
-  /usr/local/X11
-  /usr/freeware
-)
-
-# set the user variables
-if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
-  set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
-endif()
-set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
-
-if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
-    file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
-         REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
-
-    unset(FREETYPE_VERSION_STRING)
-    foreach(VPART MAJOR MINOR PATCH)
-        foreach(VLINE ${freetype_version_str})
-            if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
-                string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
-                       FREETYPE_VERSION_PART "${VLINE}")
-                if(FREETYPE_VERSION_STRING)
-                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
-                else()
-                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
-                endif()
-                unset(FREETYPE_VERSION_PART)
-            endif()
-        endforeach()
-    endforeach()
-endif()
-
-
-# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
-# all listed variables are TRUE
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
-                                  REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
-                                  VERSION_VAR FREETYPE_VERSION_STRING)
-
-mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindICONV.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindICONV.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindICONV.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,11 +1,11 @@
-# - Try to find Iconv 
-# Once done this will define 
-# 
-#  ICONV_FOUND - system has Iconv 
-#  ICONV_INCLUDE_DIR - the Iconv include directory 
-#  ICONV_LIBRARIES - Link these to use Iconv 
+# - Try to find Iconv
+# Once done this will define
+#
+#  ICONV_FOUND - system has Iconv
+#  ICONV_INCLUDE_DIR - the Iconv include directory
+#  ICONV_LIBRARIES - Link these to use Iconv
 #  ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
-# 
+#
 include(CheckCCompilerFlag)
 include(CheckCSourceCompiles)
 
@@ -14,14 +14,14 @@
   SET(ICONV_FIND_QUIETLY TRUE)
 ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
 
-FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local) 
- 
+FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local)
+
 FIND_LIBRARY(ICONV_LIBRARIES NAMES libiconv_a iconv libiconv c PATHS /opt/local)
- 
-IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
-   SET(ICONV_FOUND TRUE) 
-ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
 
+IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+   SET(ICONV_FOUND TRUE)
+ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+
 set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
 set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
 IF(ICONV_FOUND)
@@ -47,18 +47,18 @@
 set(CMAKE_REQUIRED_INCLUDES)
 set(CMAKE_REQUIRED_LIBRARIES)
 
-IF(ICONV_FOUND) 
-  IF(NOT ICONV_FIND_QUIETLY) 
-    MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") 
-  ENDIF(NOT ICONV_FIND_QUIETLY) 
-ELSE(ICONV_FOUND) 
-  IF(Iconv_FIND_REQUIRED) 
-    MESSAGE(FATAL_ERROR "Could not find Iconv") 
-  ENDIF(Iconv_FIND_REQUIRED) 
-ENDIF(ICONV_FOUND) 
+IF(ICONV_FOUND)
+  IF(NOT ICONV_FIND_QUIETLY)
+    MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
+  ENDIF(NOT ICONV_FIND_QUIETLY)
+ELSE(ICONV_FOUND)
+  IF(Iconv_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Could not find Iconv")
+  ENDIF(Iconv_FIND_REQUIRED)
+ENDIF(ICONV_FOUND)
 
 MARK_AS_ADVANCED(
   ICONV_INCLUDE_DIR
   ICONV_LIBRARIES
   ICONV_SECOND_ARGUMENT_IS_CONST
-)
\ No newline at end of file
+)

Deleted: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindJPEG.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindJPEG.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindJPEG.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,60 +0,0 @@
-# - Find JPEG
-# Find the native JPEG includes and library
-# This module defines
-#  JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
-#  JPEG_LIBRARIES, the libraries needed to use JPEG.
-#  JPEG_FOUND, If false, do not try to use JPEG.
-# also defined, but not for general use are
-#  JPEG_LIBRARY, where to find the JPEG library.
-
-#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 
-#  * Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-# 
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-find_path(JPEG_INCLUDE_DIR jpeglib.h)
-
-set(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg_a)
-find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
-
-# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
-# all listed variables are TRUE
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
-
-if(JPEG_FOUND)
-  set(JPEG_LIBRARIES ${JPEG_LIBRARY})
-endif()
-
-# Deprecated declarations.
-set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
-if(JPEG_LIBRARY)
-  get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
-endif()
-
-mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindLIQ.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindLIQ.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindLIQ.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -4,26 +4,24 @@
 # This module defines
 #  LIQ_INCLUDE_DIR, where to find libimagequant.h
 #  LIQ_LIBRARIES, the libraries to link against to use libimagequant.
-#  LIQ_FOUND, If false, do not try to use libimagequant.
+#  LIQ_FOUND, if false, do not try to use libimagequant.
 
 SET(LIQ_FOUND "NO")
 
 FIND_PATH(LIQ_INCLUDE_DIR libimagequant.h
-"${PROJECT_SOURCE_DIR}/libimagequant"
-"${PROJECT_SOURCE_DIR}/pngquant/lib"
-/usr/local/include
-/usr/include
+  /usr/local/include
+  /usr/include
 )
 
 FIND_LIBRARY(LIQ_LIBRARY
   NAMES libimagequant imagequant
-  PATHS "${PROJECT_SOURCE_DIR}/libimagequant" "${PROJECT_SOURCE_DIR}/pngquant/lib" /usr/lib64 /usr/lib /usr/local/lib
+  PATHS /usr/lib64 /usr/lib /usr/local/lib
 )
 
 IF (LIQ_LIBRARY AND LIQ_INCLUDE_DIR)
     SET(LIQ_FOUND "YES")
     SET(LIQ_LIBRARIES ${LIQ_LIBRARY})
-		SET(HAVE_LIBIMAGEQUANT 1)
+    SET(HAVE_LIBIMAGEQUANT 1)
 ENDIF (LIQ_LIBRARY AND LIQ_INCLUDE_DIR)
 
 IF (LIQ_FOUND)
@@ -30,30 +28,6 @@
   IF (NOT LIQ_FIND_QUIETLY)
     MESSAGE(STATUS "Found LIQ: ${LIQ_LIBRARY} ${LIQ_INCLUDE_DIR}")
   ENDIF (NOT LIQ_FIND_QUIETLY)
-ELSE (LIQ_FOUND)
-  # if existing library not found, then download and build it
-  IF (NOT WIN32 OR CYGWIN OR MINGW) # MSVC's C compiler is too old to compile libimagequant
-    IF (CMAKE_VERSION VERSION_GREATER "2.8.1")
-      MESSAGE(STATUS "LIQ will be built")
-      INCLUDE(ExternalProject)
-      EXTERNALPROJECT_ADD(
-          libimagequant
-          URL "http://pngquant.org/libimagequant-2.0.0-src.tar.bz2"
-          SOURCE_DIR libimagequant
-          BUILD_IN_SOURCE 1
-          INSTALL_DIR libimagequant
-          INSTALL_COMMAND true
-          CONFIGURE_COMMAND true
-          BUILD_COMMAND make static CFLAGSADD='-fPIC'
-      )
-
-      SET(LIQ_FOUND "SORTOF")
-      SET(LIQ_BUILD "YES")
-    SET(LIQ_LIBRARIES "${PROJECT_BINARY_DIR}/libimagequant/libimagequant.a")
-    SET(LIQ_INCLUDE_DIR "${PROJECT_BINARY_DIR}/libimagequant/")
-      SET(HAVE_LIBIMAGEQUANT 1)
-    ENDIF(CMAKE_VERSION VERSION_GREATER "2.8.1")
-  ENDIF(NOT WIN32 OR CYGWIN OR MINGW)
 ENDIF (LIQ_FOUND)
 
 MARK_AS_ADVANCED(LIQ_INCLUDE_DIR LIQ_LIBRARIES LIQ_BUILD)

Deleted: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPNG.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPNG.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPNG.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,93 +0,0 @@
-# - Find the native PNG includes and library
-#
-# This module searches libpng, the library for working with PNG images.
-#
-# It defines the following variables
-#  PNG_INCLUDE_DIRS, where to find png.h, etc.
-#  PNG_LIBRARIES, the libraries to link against to use PNG.
-#  PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
-#  PNG_FOUND, If false, do not try to use PNG.
-#  PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
-# Also defined, but not for general use are
-#  PNG_LIBRARY, where to find the PNG library.
-# For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS.
-#
-# Since PNG depends on the ZLib compression library, none of the above will be
-# defined unless ZLib can be found.
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 
-#  * Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-# 
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-if(PNG_FIND_QUIETLY)
-  set(_FIND_ZLIB_ARG QUIET)
-endif()
-find_package(ZLIB ${_FIND_ZLIB_ARG})
-
-if(ZLIB_FOUND)
-  find_path(PNG_PNG_INCLUDE_DIR png.h
-  /usr/local/include/libpng             # OpenBSD
-  )
-
-  set(PNG_NAMES ${PNG_NAMES} png libpng png15 libpng15 png15d libpng15d png14 libpng14 png14d libpng14d png12 libpng12 png12d libpng12d libpng_a)
-  find_library(PNG_LIBRARY NAMES ${PNG_NAMES} )
-
-  if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
-      # png.h includes zlib.h. Sigh.
-      set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
-      set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
-      set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
-
-      if (CYGWIN)
-        if(BUILD_SHARED_LIBS)
-           # No need to define PNG_USE_DLL here, because it's default for Cygwin.
-        else()
-          set (PNG_DEFINITIONS -DPNG_STATIC)
-        endif()
-      endif ()
-
-  endif ()
-
-  if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
-      file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
-
-      string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
-      unset(png_version_str)
-  endif ()
-endif()
-
-# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
-# all listed variables are TRUE
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(PNG
-                                  REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
-                                  VERSION_VAR PNG_VERSION_STRING)
-
-mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPTHREAD.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPTHREAD.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPTHREAD.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,92 +1,90 @@
-#############################################################################
-#
-# $Id: FindPTHREAD.cmake 4056 2013-01-05 13:04:42Z fspindle $
-#
-# This file is part of the ViSP software.
-# Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
-# 
-# This software is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# ("GPL") version 2 as published by the Free Software Foundation.
-# See the file LICENSE.txt at the root directory of this source
-# distribution for additional information about the GNU GPL.
-#
-# For using ViSP with software that can not be combined with the GNU
-# GPL, please contact INRIA about acquiring a ViSP Professional 
-# Edition License.
-#
-# See http://www.irisa.fr/lagadic/visp/visp.html for more information.
-# 
-# This software was developed at:
-# INRIA Rennes - Bretagne Atlantique
-# Campus Universitaire de Beaulieu
-# 35042 Rennes Cedex
-# France
-# http://www.irisa.fr/lagadic
-#
-# If you have questions regarding the use of this file, please contact
-# INRIA at visp at inria.fr
-# 
-# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# Description:
-# Try to find pthread library.
-# Once run this will define: 
-#
-# PTHREAD_FOUND
-# PTHREAD_INCLUDE_DIRS
-# PTHREAD_LIBRARIES
-#
-# Authors:
-# Fabien Spindler
-#
-#############################################################################
-
-  
-  FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h
-    "$ENV{PTHREAD_HOME}/include"
-    "$ENV{PTHREAD_DIR}/include"
-    /usr/include
-    "C:/MinGW/include"
-  )
-  #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}")
-  
-  # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web
-  FIND_LIBRARY(PTHREAD_LIBRARY
-    NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2
-    PATHS
-    "$ENV{PTHREAD_HOME}/lib"
-    "$ENV{PTHREAD_DIR}/lib"
-    /usr/lib
-    /usr/local/lib
-    /lib    
-    "C:/MinGW/lib"
-    )
-
-  #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}")
-  
-  ## --------------------------------
-  
-  IF(PTHREAD_LIBRARY)
-    SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
-  ELSE(PTHREAD_LIBRARY)
-    #MESSAGE(SEND_ERROR "pthread library not found.")
-  ENDIF(PTHREAD_LIBRARY)
-  
-  IF(NOT PTHREAD_INCLUDE_DIR)
-    #MESSAGE(SEND_ERROR "pthread include dir not found.")
-  ENDIF(NOT PTHREAD_INCLUDE_DIR)
-  
-  IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
-    SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
-    SET(PTHREAD_FOUND TRUE)
-  ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
-    SET(PTHREAD_FOUND FALSE)
-  ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
-  
-  MARK_AS_ADVANCED(
-    PTHREAD_INCLUDE_DIR
-    PTHREAD_LIBRARY
-  )
-  #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}")
+#############################################################################
+#
+# This file is part of the ViSP software.
+# Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
+#
+# This software is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# ("GPL") version 2 as published by the Free Software Foundation.
+# See the file LICENSE.txt at the root directory of this source
+# distribution for additional information about the GNU GPL.
+#
+# For using ViSP with software that can not be combined with the GNU
+# GPL, please contact INRIA about acquiring a ViSP Professional
+# Edition License.
+#
+# See http://www.irisa.fr/lagadic/visp/visp.html for more information.
+#
+# This software was developed at:
+# INRIA Rennes - Bretagne Atlantique
+# Campus Universitaire de Beaulieu
+# 35042 Rennes Cedex
+# France
+# http://www.irisa.fr/lagadic
+#
+# If you have questions regarding the use of this file, please contact
+# INRIA at visp at inria.fr
+#
+# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Description:
+# Try to find pthread library.
+# Once run this will define:
+#
+# PTHREAD_FOUND
+# PTHREAD_INCLUDE_DIRS
+# PTHREAD_LIBRARIES
+#
+# Authors:
+# Fabien Spindler
+#
+#############################################################################
+
+
+  FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h
+    "$ENV{PTHREAD_HOME}/include"
+    "$ENV{PTHREAD_DIR}/include"
+    /usr/include
+    "C:/MinGW/include"
+  )
+  #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}")
+
+  # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web
+  FIND_LIBRARY(PTHREAD_LIBRARY
+    NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2
+    PATHS
+    "$ENV{PTHREAD_HOME}/lib"
+    "$ENV{PTHREAD_DIR}/lib"
+    /usr/lib
+    /usr/local/lib
+    /lib
+    "C:/MinGW/lib"
+    )
+
+  #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}")
+
+  ## --------------------------------
+
+  IF(PTHREAD_LIBRARY)
+    SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
+  ELSE(PTHREAD_LIBRARY)
+    #MESSAGE(SEND_ERROR "pthread library not found.")
+  ENDIF(PTHREAD_LIBRARY)
+
+  IF(NOT PTHREAD_INCLUDE_DIR)
+    #MESSAGE(SEND_ERROR "pthread include dir not found.")
+  ENDIF(NOT PTHREAD_INCLUDE_DIR)
+
+  IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
+    SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
+    SET(PTHREAD_FOUND TRUE)
+  ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
+    SET(PTHREAD_FOUND FALSE)
+  ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
+
+  MARK_AS_ADVANCED(
+    PTHREAD_INCLUDE_DIR
+    PTHREAD_LIBRARY
+  )
+  #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}")

Deleted: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPackageHandleStandardArgs.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPackageHandleStandardArgs.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindPackageHandleStandardArgs.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,317 +0,0 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
-#
-# This function is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED, QUIET and version-related arguments to find_package().
-# It also sets the <UPPERCASED_NAME>_FOUND variable.
-# The package is considered found if all variables <var1>... listed contain
-# valid results, e.g. valid filepaths.
-#
-# There are two modes of this function. The first argument in both modes is
-# the name of the Find-module where it is called (in original casing).
-#
-# The first simple mode looks like this:
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
-# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
-# will be set to TRUE.
-# If DEFAULT_MSG is given as second argument, then the function will generate
-# itself useful success and error messages. You can also supply a custom error message
-# for the failure case. This is not recommended.
-#
-# The second mode is more powerful and also supports version checking:
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
-#                                           [VERSION_VAR   <versionvar>]
-#                                           [HANDLE_COMPONENTS]
-#                                           [CONFIG_MODE]
-#                                           [FAIL_MESSAGE "Custom failure message"] )
-#
-# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
-# will be set to TRUE.
-# After REQUIRED_VARS the variables which are required for this package are listed.
-# Following VERSION_VAR the name of the variable can be specified which holds
-# the version of the package which has been found. If this is done, this version
-# will be checked against the (potentially) specified required version used
-# in the find_package() call. The EXACT keyword is also handled. The default
-# messages include information about the required version and the version
-# which has been actually found, both if the version is ok or not.
-# If the package supports components, use the HANDLE_COMPONENTS option to enable
-# handling them. In this case, find_package_handle_standard_args() will report
-# which components have been found and which are missing, and the <NAME>_FOUND
-# variable will be set to FALSE if any of the required components (i.e. not the
-# ones listed after OPTIONAL_COMPONENTS) are missing.
-# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
-# a find_package(... NO_MODULE) call.  In this case VERSION_VAR will be set
-# to <NAME>_VERSION and the macro will automatically check whether the
-# Config module was found.
-# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
-# used, the default message will be displayed.
-#
-# Example for mode 1:
-#
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-#
-# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
-# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
-# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
-# independent whether QUIET was used or not.
-# If it is found, success will be reported, including the content of <var1>.
-# On repeated Cmake runs, the same message won't be printed again.
-#
-# Example for mode 2:
-#
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON  REQUIRED_VARS BISON_EXECUTABLE
-#                                             VERSION_VAR BISON_VERSION)
-# In this case, BISON is considered to be found if the variable(s) listed
-# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
-# Also the version of BISON will be checked by using the version contained
-# in BISON_VERSION.
-# Since no FAIL_MESSAGE is given, the default messages will be printed.
-#
-# Another example for mode 2:
-#
-#    find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4  CONFIG_MODE)
-# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 NO_MODULE)
-# and adds an additional search directory for automoc4.
-# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
-# success/error message.
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 
-#  * Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-# 
-#  * The names of Kitware, Inc., the Insight Consortium, or the names of
-#    any consortium members, or of any contributors, may not be used to
-#    endorse or promote products derived from this software without
-#    specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-include(FindPackageMessage)
-include(CMakeParseArguments)
-
-# internal helper macro
-macro(_FPHSA_FAILURE_MESSAGE _msg)
-  if (${_NAME}_FIND_REQUIRED)
-    message(FATAL_ERROR "${_msg}")
-  else ()
-    if (NOT ${_NAME}_FIND_QUIETLY)
-      message(STATUS "${_msg}")
-    endif ()
-  endif ()
-endmacro()
-
-
-# internal helper macro to generate the failure message when used in CONFIG_MODE:
-macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
-  # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
-  if(${_NAME}_CONFIG)
-    _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
-  else()
-    # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
-    # List them all in the error message:
-    if(${_NAME}_CONSIDERED_CONFIGS)
-      set(configsText "")
-      list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
-      math(EXPR configsCount "${configsCount} - 1")
-      foreach(currentConfigIndex RANGE ${configsCount})
-        list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
-        list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
-        set(configsText "${configsText}    ${filename} (version ${version})\n")
-      endforeach()
-      if (${_NAME}_NOT_FOUND_MESSAGE)
-        set(configsText "${configsText}    Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
-      endif()
-      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
-
-    else()
-      # Simple case: No Config-file was found at all:
-      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
-    endif()
-  endif()
-endmacro()
-
-
-function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
-
-# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
-# new extended or in the "old" mode:
-  set(options CONFIG_MODE HANDLE_COMPONENTS)
-  set(oneValueArgs FAIL_MESSAGE VERSION_VAR)
-  set(multiValueArgs REQUIRED_VARS)
-  set(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
-  list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
-
-  if(${INDEX} EQUAL -1)
-    set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
-    set(FPHSA_REQUIRED_VARS ${ARGN})
-    set(FPHSA_VERSION_VAR)
-  else()
-
-    CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
-
-    if(FPHSA_UNPARSED_ARGUMENTS)
-      message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
-    endif()
-
-    if(NOT FPHSA_FAIL_MESSAGE)
-      set(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
-    endif()
-  endif()
-
-# now that we collected all arguments, process them
-
-  if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
-    set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
-  endif()
-
-  # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
-  # when it successfully found the config-file, including version checking:
-  if(FPHSA_CONFIG_MODE)
-    list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
-    list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
-    set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
-  endif()
-
-  if(NOT FPHSA_REQUIRED_VARS)
-    message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
-  endif()
-
-  list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
-
-  string(TOUPPER ${_NAME} _NAME_UPPER)
-  string(TOLOWER ${_NAME} _NAME_LOWER)
-
-  # collect all variables which were not found, so they can be printed, so the
-  # user knows better what went wrong (#6375)
-  set(MISSING_VARS "")
-  set(DETAILS "")
-  set(${_NAME_UPPER}_FOUND TRUE)
-  # check if all passed variables are valid
-  foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
-    if(NOT ${_CURRENT_VAR})
-      set(${_NAME_UPPER}_FOUND FALSE)
-      set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
-    else()
-      set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
-    endif()
-  endforeach()
-
-  # component handling
-  unset(FOUND_COMPONENTS_MSG)
-  unset(MISSING_COMPONENTS_MSG)
-
-  if(FPHSA_HANDLE_COMPONENTS)
-    foreach(comp ${${_NAME}_FIND_COMPONENTS})
-      if(${_NAME}_${comp}_FOUND)
-
-        if(NOT DEFINED FOUND_COMPONENTS_MSG)
-          set(FOUND_COMPONENTS_MSG "found components: ")
-        endif()
-        set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
-
-      else()
-
-        if(NOT DEFINED MISSING_COMPONENTS_MSG)
-          set(MISSING_COMPONENTS_MSG "missing components: ")
-        endif()
-        set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
-
-        if(${_NAME}_FIND_REQUIRED_${comp})
-          set(${_NAME_UPPER}_FOUND FALSE)
-          set(MISSING_VARS "${MISSING_VARS} ${comp}")
-        endif()
-
-      endif()
-    endforeach()
-    set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
-    set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
-  endif()
-
-  # version handling:
-  set(VERSION_MSG "")
-  set(VERSION_OK TRUE)
-  set(VERSION ${${FPHSA_VERSION_VAR}} )
-  if (${_NAME}_FIND_VERSION)
-
-    if(VERSION)
-
-      if(${_NAME}_FIND_VERSION_EXACT)       # exact version required
-        if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
-          set(VERSION_OK FALSE)
-        else ()
-          set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
-        endif ()
-
-      else()     # minimum version specified:
-        if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
-          set(VERSION_OK FALSE)
-        else ()
-          set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
-        endif ()
-      endif()
-
-    else()
-
-      # if the package was not found, but a version was given, add that to the output:
-      if(${_NAME}_FIND_VERSION_EXACT)
-         set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
-      else()
-         set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
-      endif()
-
-    endif()
-  else ()
-    if(VERSION)
-      set(VERSION_MSG "(found version \"${VERSION}\")")
-    endif()
-  endif ()
-
-  if(VERSION_OK)
-    set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
-  else()
-    set(${_NAME_UPPER}_FOUND FALSE)
-  endif()
-
-
-  # print the result:
-  if (${_NAME_UPPER}_FOUND)
-    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
-  else ()
-
-    if(FPHSA_CONFIG_MODE)
-      _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
-    else()
-      if(NOT VERSION_OK)
-        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
-      else()
-        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
-      endif()
-    endif()
-
-  endif ()
-
-  set(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
-
-endfunction()

Added: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindRAQM.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindRAQM.cmake	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindRAQM.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,69 @@
+# - Find the native RAQM includes and library
+#
+
+# This module defines
+#  RAQM_INCLUDE_DIR, where to find raqm.h, etc.
+#  RAQM_LIBRARIES, the libraries to link against to use RAQM.
+#  RAQM_FOUND, If false, do not try to use RAQM.
+# Also defined, but not for general use are
+#  RAQM_LIBRARY, where to find the RAQM library.
+
+# Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#  * Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+#
+#  * Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+#  * The names of Kitware, Inc., the Insight Consortium, or the names of
+#    any consortium members, or of any contributors, may not be used to
+#    endorse or promote products derived from this software without
+#    specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SET(RAQM_FOUND "NO")
+
+FIND_PATH(RAQM_INCLUDE_DIR raqm.h
+  /usr/local/include
+  /usr/include
+)
+
+SET(RAQM_NAMES ${RAQM_NAMES} raqm)
+FIND_LIBRARY(RAQM_LIBRARY
+  NAMES ${RAQM_NAMES}
+  PATH /usr/local/lib /usr/lib
+)
+
+IF (RAQM_LIBRARY AND RAQM_INCLUDE_DIR)
+	SET(RAQM_FOUND "YES")
+	SET(HAVE_LIBRAQM 1)
+	SET(RAQM_LIBRARIES ${RAQM_LIBRARY})
+ENDIF (RAQM_LIBRARY AND RAQM_INCLUDE_DIR)
+
+IF (RAQM_FOUND)
+	IF (NOT RAQM_FIND_QUIETLY)
+		MESSAGE(STATUS "Find RAQM: ${RAQM_LIBRARY}")
+	ENDIF (NOT RAQM_FIND_QUIETLY)
+ELSE (RAQM_FOUDN)
+	IF (RAQM_FIND_REQUIRED)
+		MESSAGE(FATAL_ERROR "Could not find RAQM library")
+	ENDIF (RAQM_FIND_REQUIRED)
+ENDIF (RAQM_FOUND)
+
+MARK_AS_ADVANCED(RAQM_INCLUDE_DIR RAQM_LIBRARY)

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindWEBP.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindWEBP.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindWEBP.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,9 +2,8 @@
 #
 
 # This module defines
-#  WEBP_INCLUDE_DIR, where to find png.h, etc.
+#  WEBP_INCLUDE_DIR, where to find decode.h, etc.
 #  WEBP_LIBRARIES, the libraries to link against to use WEBP.
-#  WEBP_DEFINITIONS - You should ADD_DEFINITONS(${WEBP_DEFINITIONS}) before compiling code that includes png library files.
 #  WEBP_FOUND, If false, do not try to use WEBP.
 # also defined, but not for general use are
 #  WEBP_LIBRARY, where to find the WEBP library.
@@ -17,16 +16,16 @@
 #
 #  * Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
-# 
+#
 #  * Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
-# 
+#
 #  * The names of Kitware, Inc., the Insight Consortium, or the names of
 #    any consortium members, or of any contributors, may not be used to
 #    endorse or promote products derived from this software without
 #    specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindXPM.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindXPM.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/FindXPM.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,9 +2,9 @@
 #
 
 # This module defines
-#  XPM_INCLUDE_DIR, where to find png.h, etc.
+#  XPM_INCLUDE_DIR, where to find xpm.h, etc.
 #  XPM_LIBRARIES, the libraries to link against to use XPM.
-#  XPM_DEFINITIONS - You should ADD_DEFINITONS(${XPM_DEFINITIONS}) before compiling code that includes png library files.
+#  XPM_DEFINITIONS - You should ADD_DEFINITONS(${XPM_DEFINITIONS}) before compiling code that includes xpm library files.
 #  XPM_FOUND, If false, do not try to use XPM.
 # also defined, but not for general use are
 #  XPM_LIBRARY, where to find the XPM library.
@@ -17,16 +17,16 @@
 #
 #  * Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
-# 
+#
 #  * Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
-# 
+#
 #  * The names of Kitware, Inc., the Insight Consortium, or the names of
 #    any consortium members, or of any contributors, may not be used to
 #    endorse or promote products derived from this software without
 #    specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2006  Alan W. Irwin
  *
  * This file is part of PLplot.

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/TestForHighBitCharacters.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -19,11 +19,11 @@
 
 # Check if ctype.h macros work on characters with the high bit set.
 if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
-   message(STATUS 
+   message(STATUS
       "Check for whether ctype.h macros work on characters with the\n"
    "   high bit set."
    )
-  try_compile(CMAKE_HIGH_BIT_CHARACTERS  
+  try_compile(CMAKE_HIGH_BIT_CHARACTERS
     ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/CMakeModules/TestForHighBitCharacters.c
     OUTPUT_VARIABLE OUTPUT)

Modified: trunk/Build/source/libs/gd/libgd-src/cmake/modules/gd.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/cmake/modules/gd.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/cmake/modules/gd.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,7 +7,11 @@
 	FOREACH(test_name ${TESTS_FILES})
 		SET(test_prog_name "test_${TEST_PREFIX}_${test_name}")
 		add_executable(${test_prog_name} "${test_name}.c")
-		target_link_libraries (${test_prog_name} gdTest ${ARGV0})
+		IF(WIN32)
+			target_link_libraries (${test_prog_name} gdTest ${ARGV0})
+		ELSE(WIN32)
+			target_link_libraries (${test_prog_name} gdTest m ${ARGV0})
+		ENDIF(WIN32)
 		add_test(NAME ${test_prog_name} COMMAND ${test_prog_name})
 	ENDFOREACH(test_name)
 ENDMACRO(ADD_GD_TESTS)

Modified: trunk/Build/source/libs/gd/libgd-src/config/Makefile.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/config/Makefile.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/config/Makefile.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_DIST = gdlib-config.in gdlib.pc.in getver.pl
+EXTRA_DIST = gdlib.pc.cmake gdlib.pc.in getver.pl
 
-bin_SCRIPTS = gdlib-config
-
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gdlib.pc

Deleted: trunk/Build/source/libs/gd/libgd-src/config/gdlib-config.in
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/config/gdlib-config.in	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/config/gdlib-config.in	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,99 +0,0 @@
-#!/bin/sh
-#
-# Return information about the local GD library installation
-#
-# Modeled after pdflib-config
-
-echo "gdlib-config: warning: this script is deprecated;" \
-     "please use the pkg-config file instead." >&2
-
-# installation directories
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-bindir=@bindir@
-
-usage()
-{
-	cat <<EOF
-Print information on GD library's version, configuration, and use.
-Usage: gdlib-config [options]
-Options:
-	--libdir          # directory where GD library is installed
-	--includedir      # directory where GD library headers are installed
-	--version         # complete GD library version string
-	--majorversion    # GD library major version number
-	--minorversion    # GD library minor version number
-	--revision        # GD library revision version number
-	--ldflags         # options required for linking against GD library
-	--libs            # libs required for linking against GD library
-	--cflags          # options required for compiling GD library apps
-	--includes        # same as --cflags
-	--features        # lists features compiled into gd, separated by spaces.
-                          # Currently (as of @VERSION@) the optional features
-                          # are GD_PNG, GD_JPEG, GD_XPM, GD_FREETYPE, and 
-                          # GD_FONTCONFIG. When these features are reported by
-                          # --features, it is safe to include calls to the
-                          # related functions in your code.
-	--all             # print a summary of all GD library configure options
-EOF
-	exit $1
-}
-
-if test $# -eq 0; then
-	usage 1 1>&2
-fi
-
-while test $# -gt 0; do
-    case "$1" in
-    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-    *) optarg= ;;
-    esac
-
-    case $1 in
-    --libdir)
-	echo $libdir
-	;;
-    --includedir)
-	echo $includedir
-	;;
-    --version)
-	echo @VERSION@
-	;;
-    --majorversion)
-	echo @GDLIB_MAJOR@
-	;;
-    --minorversion)
-	echo @GDLIB_MINOR@
-	;;
-    --revision)
-	echo @GDLIB_REVISION@
-	;;
-    --ldflags)
-	echo @LDFLAGS@
-	;;
-    --libs)
-	echo -lgd @LIBS@ @LIBICONV@
-	;;
-    --cflags|--includes)
-	echo -I at includedir@
-	;;
-    --features)
-	echo @FEATURES@
-	;;
-    --all)
-	echo "GD library  @VERSION@"
-	echo "includedir: $includedir"
-	echo "cflags:     -I at includedir@"
-	echo "ldflags:    @LDFLAGS@"
-	echo "libs:       @LIBS@ @LIBICONV@"
-	echo "libdir:     $libdir"
-	echo "features:   @FEATURES@"
-	;;
-    *)
-	usage 1 1>&2
-	;;
-    esac
-    shift
-done

Added: trunk/Build/source/libs/gd/libgd-src/config/gdlib.pc.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/config/gdlib.pc.cmake	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/config/gdlib.pc.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,9 @@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: gd
+Description: GD graphics library
+Version: @GDLIB_VERSION@
+Cflags: -I${includedir}
+Libs.private: @LIBGD_DEP_LIBS@
+Libs: -L${libdir} -lgd

Modified: trunk/Build/source/libs/gd/libgd-src/config/getver.pl
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/config/getver.pl	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/config/getver.pl	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,11 +8,14 @@
 
 use strict;
 
+use FindBin;
+
 my $key = shift;
 my @version_parts = ();
+my $dir = $FindBin::Bin;
 
-open FH, "<src/gd.h"   # old-style filehandle for max. portability
-  or die "Unable to open 'version.h' for reading.\n";
+open FH, "<$dir/../src/gd.h"   # old-style filehandle for max. portability
+  or die "Unable to open 'gd.h' for reading.\n";
 
 while(<FH>) {
   next unless m{version605b5d1778};

Modified: trunk/Build/source/libs/gd/libgd-src/configure.ac
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/configure.ac	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/configure.ac	2020-04-10 03:40:48 UTC (rev 54636)
@@ -18,46 +18,21 @@
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 
-# This is not used anywhere.  However, Makefile.netware searches
-# through configure for these definitions to find the version numbers.
-# (Assuming anyone still uses Netware, that should be changed to use
-# gd.h via getver.pl instead.)
-GDLIB_MAJOR=gd_MAJOR
-GDLIB_MINOR=gd_MINOR
-GDLIB_REVISION=gd_REVISION
-GDLIB_EXTRA=gd_EXTRA
-GDLIB_VERSION=gd_PKG_VERSION
+dnl Keep the libtool version details in an external script so cmake can
+dnl access the values too.
+define([lt_gv], [config/getlib.sh ]$1)
+m4_define([gd_LT_CURRENT], esyscmd(lt_gv(CURRENT)))
+m4_define([gd_LT_REVISION], esyscmd(lt_gv(REVISION)))
+m4_define([gd_LT_AGE], esyscmd(lt_gv(AGE)))
 
-AC_SUBST(GDLIB_MAJOR)
-AC_SUBST(GDLIB_MINOR)
-AC_SUBST(GDLIB_REVISION)
-AC_SUBST(GDLIB_EXTRA)
-AC_SUBST(GDLIB_VERSION)
+GDLIB_LT_CURRENT=gd_LT_CURRENT
+GDLIB_LT_REVISION=gd_LT_REVISION
+GDLIB_LT_AGE=gd_LT_AGE
 
-# Dynamic library version information
-# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
-
-GDLIB_LT_CURRENT=3
-dnl This is the version where the soname (current above) changes.  We use it
-dnl to reset the revision base back to zero.  It's a bit of a pain, but some
-dnl systems restrict the revision range below to [0..255] (like OS X).
-GDLIB_PREV_MAJOR=2
-GDLIB_PREV_MINOR=2
-dnl This isn't 100% correct, but it tends to be a close enough approximation
-dnl for how we manage the codebase.  It's rare to do a release that doesn't
-dnl modify the library since this project is centered around the library.
-GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR - GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION ))
-GDLIB_LT_AGE=0
 AC_SUBST(GDLIB_LT_CURRENT)
 AC_SUBST(GDLIB_LT_REVISION)
 AC_SUBST(GDLIB_LT_AGE)
 
-#Expanded by tests later in this file. TBB 2.0.26
-#2.0.28: GIF is standard now. Doesn't depend on anything else,
-#so we always build it.
-FEATURES="GD_GIF GD_GIFANIM GD_OPENPOLYGON"
-AC_SUBST(FEATURES)
-
 AM_INIT_AUTOMAKE([1.11 foreign dist-xz -Wall -Werror subdir-objects])
 AC_CONFIG_HEADERS([src/config.h:src/config.hin])
 
@@ -85,13 +60,8 @@
 AC_HEADER_STDC
 AC_CHECK_HEADERS_ONCE(m4_flatten([
 	dirent.h
-	errno.h
 	inttypes.h
-	limits.h
-	stddef.h
 	stdint.h
-	stdlib.h
-	string.h
 	strings.h
 	unistd.h
 	sys/stat.h
@@ -114,7 +84,6 @@
       AC_MSG_RESULT(no))])
 
 # Checks for typedefs, structures, and compiler characteristics.
-#AC_C_CONST
 #AC_TYPE_SIZE_T
 
 # Checks for library functions.
@@ -121,7 +90,6 @@
 #AC_FUNC_ERROR_AT_LINE
 #AC_FUNC_MALLOC
 #AC_FUNC_REALLOC
-#AC_FUNC_VPRINTF
 #AC_CHECK_FUNCS([floor memset sqrt strchr strdup strtol])
 
 dnl do we need to specify -lm explicitly?
@@ -130,6 +98,21 @@
 AX_PTHREAD()
 AX_OPENMP()
 
+dnl We should default this to off in future releases.
+AC_MSG_CHECKING([whether to support gd image formats])
+AC_ARG_ENABLE([gd-formats],
+  [AS_HELP_STRING([--disable-gd-formats], [Disable support for the legacy/testing gd image formats])],
+  [gd_enable_gd_formats=$enableval],
+  [gd_enable_gd_formats=yes])
+AC_MSG_RESULT([$gd_enable_gd_formats])
+if test "$gd_enable_gd_formats" = yes; then
+  gd_ac_value=1
+else
+  gd_ac_value=0
+fi
+AC_DEFINE_UNQUOTED([ENABLE_GD_FORMATS], [$gd_ac_value], [Whether to support gd image formats])
+AM_CONDITIONAL([ENABLE_GD_FORMATS], test "$gd_enable_gd_formats" = yes)
+
 dnl Helper macro for working with external libraries.
 dnl GD_LIB_CHECK([SYM], [FEATURE], [name], [...test...])
 dnl $1 - upper case symbol
@@ -173,7 +156,6 @@
 
     if test "$gd_found_lib" = "yes"; then
       AC_DEFINE([HAVE_$1], [1], [Define if you have $3])
-      AS_VAR_APPEND([FEATURES], [" GD_$2"])
       dnl Merge the flags into the main LIBS/CPPFLAGS.
       $1][_LIBS="$gd_lib_ldflags $][$1][_LIBS"
       $1][_CFLAGS="$gd_lib_cflags $][$1][_CFLAGS"
@@ -233,6 +215,14 @@
   AC_DEFINE([HAVE_FT2BUILD_H], [1], [Define if you have the ft2build.h header.])
 fi
 
+dnl Check for Raqm support.
+GD_LIB_PKG_CHECK([LIBRAQM], [RAQM], [raqm], [raqm], [
+  AC_CHECK_LIB([raqm], [raqm_create], [dnl
+    AS_VAR_APPEND([LIBRAQM_LIBS], [" -lraqm -lfreetype"])
+    gd_found_lib=yes
+  ])
+])
+
 dnl Check for fontconfig support.
 GD_LIB_PKG_CHECK([LIBFONTCONFIG], [FONTCONFIG], [fontconfig], [fontconfig], [
   AC_CHECK_LIB([fontconfig], [FcInit], [dnl
@@ -242,7 +232,7 @@
 ])
 
 dnl Check for jpeg support.
-GD_LIB_CHECK([LIBJPEG], [JPEG], [jpeg], [
+GD_LIB_PKG_CHECK([LIBJPEG], [JPEG], [jpeg], [libjpeg], [
   AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [dnl
     AS_VAR_APPEND([LIBJPEG_LIBS], [" -ljpeg"])
     gd_found_lib=yes
@@ -310,6 +300,7 @@
 AC_MSG_RESULT([
 ** Configuration summary for $PACKAGE $VERSION:
 
+   Support for gd/gd2 images:        $gd_enable_gd_formats
    Support for Zlib:                 $gd_with_LIBZ
    Support for PNG library:          $gd_with_LIBPNG
    Support for JPEG library:         $gd_with_LIBJPEG
@@ -319,6 +310,7 @@
    Support for Fontconfig library:   $gd_with_LIBFONTCONFIG
    Support for Xpm library:          $gd_with_LIBXPM
    Support for liq library:          $gd_with_LIBIMAGEQUANT
+   Support for complex text:         $gd_with_LIBRAQM
    Support for pthreads:             $ax_pthread_ok
 ])
 
@@ -326,7 +318,6 @@
                 src/Makefile
                 tests/Makefile
                 config/Makefile
-                config/gdlib-config
                 config/gdlib.pc])
 
 AC_OUTPUT

Modified: trunk/Build/source/libs/gd/libgd-src/docs/INSTALL
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/INSTALL	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/INSTALL	2020-04-10 03:40:48 UTC (rev 54636)
@@ -367,4 +367,3 @@
 
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
-

Modified: trunk/Build/source/libs/gd/libgd-src/docs/NEWS.historic
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/NEWS.historic	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/NEWS.historic	2020-04-10 03:40:48 UTC (rev 54636)
@@ -12,7 +12,7 @@
      (Pierre, Mark Fisher)
  88, Fixed support of PNG grayscale image with alpha channel (Pierre)
  95, Added Netware builds script (Guenter)
- 97, ease the creation of regexp to match symbols/functions in the sources 
+ 97, ease the creation of regexp to match symbols/functions in the sources
      (Guenter)
 100, spurious horizontal line drawn by gdImageFilledPolygon (Takeshi Abe)
 101, _gdCreateFromFile() can crash if gdImageCreate fails (Mattias Bengtsson)
@@ -37,17 +37,17 @@
 198, Fixed useFontConfig() to work as documented (Mojca Miklavec, Ethan Merritt)
 
 GD 2.0.35 (2007-06-21)
-41, Fix valgrind error in gdImageFillTiled (Nuno Lopes) 
+41, Fix valgrind error in gdImageFillTiled (Nuno Lopes)
 45, Add missing custom cmake macros (required for the tests suite)
 51, Avoid signature buffer copy  in gd_gif_c (Nuno Lopes)
-48, Race condition in gdImageStringFTEx (Antony Dogval, Pierre 
+48, Race condition in gdImageStringFTEx (Antony Dogval, Pierre
     Scott MacVicar)
 52, Reading GIF images is not thread safe (static usage in private
     functions) (Roman Nemecek, Nuno Lopes, Pierre)
 60, GIF Local palette is read twice
-66, GIF, Use local frame dimension when possible instead of the 
+66, GIF, Use local frame dimension when possible instead of the
     logical screen size (Pierre)
-68, OpenVMS build support, see VMS/README.VMS for the details 
+68, OpenVMS build support, see VMS/README.VMS for the details
     (Alexey Chupahin)
 70, GIF, do not try to use the global colmap if it does not exist
     (Nuno Lopes, Pierre)
@@ -58,7 +58,7 @@
     (Pierre)
 86, Possible infinite loop in libgd/gd_png.c, flaw found by Xavier Roche
     (Pierre)
-87, Fixed segfault when an invalid color index is present in a GIF 
+87, Fixed segfault when an invalid color index is present in a GIF
     image data, reported by Elliot <wccode at gmail dot com> (Pierre)
 89, Possible integer overflow in gdImageCreateTrueColor (Pierre)
 94, gdImageCreateXbm can crash if gdImageCreate fails (Pierre)

Modified: trunk/Build/source/libs/gd/libgd-src/docs/README.CMAKE
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/README.CMAKE	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/README.CMAKE	2020-04-10 03:40:48 UTC (rev 54636)
@@ -10,13 +10,17 @@
 $ make
 
 The available options are:
+ENABLE_GD_FORMATS=1
 ENABLE_PNG=1
+ENABLE_LIQ=1
 ENABLE_JPEG=1
 ENABLE_TIFF=1
+ENABLE_ICONV=1
 ENABLE_FREETYPE=1
 ENABLE_FONTCONFIG=1
 ENABLE_XPM=1
 ENABLE_WEBP=1
+ENABLE_RAQM=1
 
 You can optionally run our tests suite using:
 $ ctest .

Modified: trunk/Build/source/libs/gd/libgd-src/docs/README.JPN
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/README.JPN	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/README.JPN	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,39 +1,38 @@
-	gd $B%i%$%V%i%j$GF|K\8lJ8;zNs$r;H$&>e$G$NCm0U;v9`(B
+	gd ライブラリで日本語文字列を使う上での注意事項
 
-					$B;32l at 5?M(B (ma at yama-ga.com)
+					山賀正人 (ma at yama-ga.com)
 
 
-gd-1.7.0 $B$+$i$O$=$N$^$^$G(B gdImageStringTTF() $B$KBP$7$F(B
-SJIS encoding $B$N%U%)%s%H$,;HMQ$G$-$^$9!#(B
+gd-1.7.0 からはそのままで gdImageStringTTF() に対して
+SJIS encoding のフォントが使用できます。
 
-	$B"((B Unicode encoding $B$N%U%)%s%H$KBP$7$F$OF|K\8lJ8;zNs$r(B UTF-8 $B$G(B
-	   $B;XDj$9$l$PF|K\8l$,I=<($G$-$^$9!#(B
+	※ Unicode encoding のフォントに対しては日本語文字列を UTF-8 で
+	   指定すれば日本語が表示できます。
 
-$B$D$^$j(B gdImageStringTTF() $B$G(B SJIS encoding $B$N%U%)%s%H$r;XDj$9$k$H(B
-$BJ8;zNs$OL5>r7o$KF|K\8l$G$"$k$H2r<a$5$l!"4A;z%3!<%I(B (EUC, SJIS, 7bit JIS)
-$B$,<+F0H=JL$5$l$FE, at Z$K=hM}$5$l$^$9!#(B
+つまり gdImageStringTTF() で SJIS encoding のフォントを指定すると
+文字列は無条件に日本語であると解釈され、漢字コード (EUC, SJIS, 7bit JIS)
+が自動判別されて適切に処理されます。
 
-$B99$K(B UNICODE encoding $B$N%U%)%s%H$KBP$7$F$b(B JIS $B7O$NF|K\8l(B (EUC, SJIS, 7bit JIS)
-$B$r;HMQ$9$k>l9g$O!"%3%s%Q%$%k;~$K(B -DJISX0208 $B$rIU$1$F%3%s%Q%$%k$7$F$/$@$5$$!#(B
-$B$3$&$9$k$H(B gdImageStringTTF() $B$G;XDj$5$l$?J8;zNs$K(B ASCII $B0J30$NJ8;z$,$"$k$H(B
-$BL5>r7o$KF|K\8lJ8;zNs$G$"$k$H2r<a$5$l!"4A;z%3!<%I$r<+F0H=JL8e$K(B
-$BE, at Z$K=hM}$5$l$^$9!#(B
+更に UNICODE encoding のフォントに対しても JIS 系の日本語 (EUC, SJIS, 7bit JIS)
+を使用する場合は、コンパイル時に -DJISX0208 を付けてコンパイルしてください。
+こうすると gdImageStringTTF() で指定された文字列に ASCII 以外の文字があると
+無条件に日本語文字列であると解釈され、漢字コードを自動判別後に
+適切に処理されます。
 
-$B$?$@$7$3$N>l9g$O(B UTF-8 $B$NF|K\8lJ8;zNs$r07$($J$/$J$j$^$9$N$G!"(B
-$B$4MxMQ$N4D6-Ey$K1~$8$F(B -DJISX0208 $B$rIU$1$k$+H]$+$r7h$a$F$/$@$5$$!#(B
+ただしこの場合は UTF-8 の日本語文字列を扱えなくなりますので、
+ご利用の環境等に応じて -DJISX0208 を付けるか否かを決めてください。
 
-$B4A;z%3!<%I$NJQ49$K(B OS $BIUB0$N(B iconv() $B$r;H$&>l9g$O(B
-CFLAGS $B$K(B -DHAVE_ICONV $B$rIU$1$F%3%s%Q%$%k$7$F$/$@$5$$!#(B
-$B$3$N>l9g$K(B -DHAVE_STDARG_H $B$H(B -DHAVE_ERRNO_H $B$bIU$1$F$*$/$H(B
-$B4A;z%3!<%IJQ49$N:]$K%(%i!<$,H/@8$7$?>l9g$KE, at Z$J%a%C%;!<%8$r(B
-$BI=<($9$k$h$&$K$J$j$^$9!#(B
+漢字コードの変換に OS 付属の iconv() を使う場合は
+CFLAGS に -DHAVE_ICONV を付けてコンパイルしてください。
+漢字コード変換の際にエラーが発生した場合に適切なメッセージを
+表示するようになります。
 
 
-$B!y(B EUC $B$+(B SJIS $B$+H=JL$G$-$J$+$C$?>l9g$N4A;z%3!<%I$NH=JLJ}K!(B
+☆ EUC か SJIS か判別できなかった場合の漢字コードの判別方法
 
-	(1) $B4D6-JQ?t(B LC_ALL, LC_CTYPE, LANG $B$r$3$N=gHV$G%A%'%C%/$9$k(B
-	(2) $B4D6-JQ?t$+$i$bH=JL$G$-$J$+$C$?>l9g$O(B UNIX $B$J$i$P(B EUC$B!"(B
-	    Win32 $B$J$i$P(B SJIS $B$H8+$J$9(B
+	(1) 環境変数 LC_ALL, LC_CTYPE, LANG をこの順番でチェックする
+	(2) 環境変数からも判別できなかった場合は UNIX ならば EUC、
+	    Win32 ならば SJIS と見なす
 
-$B%3%s%Q%$%k;~$K(B -DSJISPRE $B$rIU$1$F%3%s%Q%$%k$9$l$P!"(BUNIX $B$G$"$C$F$b(B
-SJIS $B$rM%@h$9$k$h$&$K$J$j$^$9!#(B
+コンパイル時に -DSJISPRE を付けてコンパイルすれば、UNIX であっても
+SJIS を優先するようになります。

Modified: trunk/Build/source/libs/gd/libgd-src/docs/README.TESTING
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/README.TESTING	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/README.TESTING	2020-04-10 03:40:48 UTC (rev 54636)
@@ -25,7 +25,7 @@
 
 then call cmake using:
 
-$ cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1 
+$ cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1
 $ make
 and finally:
 
@@ -33,18 +33,18 @@
 
 I will certainly add a nice CMake option to give prefix later.
 
-What to do if tests fail on your platform and you use the last GD release? 
+What to do if tests fail on your platform and you use the last GD release?
 either from your favorite distributions or from http://www.libgd.org or git?
 
-If you use a packaged version of the GD Library (installed from RPM, deb or 
+If you use a packaged version of the GD Library (installed from RPM, deb or
 ports, gentoo packages or any other packages format or distribution), please try
 to run the tests using the source releases available at:
 
-http://www.libgd.org/Downloads
+https://github.com/libgd/libgd/releases
 
 If the tests fail using our source release, please report a bug here:
 
-http://bugs.libgd.org
+https://github.com/libgd/libgd/issues
 
 You can attach the two files available in:
 
@@ -65,6 +65,9 @@
 Some features rely on floating point arithmetic and results may vary from
 one architecture to another.
 Examples:
-on i686, gdimagerotate/bug00067 will fail. The result is still visually
+On i686, gdimagerotate/bug00067 will fail. The result is still visually
 acceptable but i686 default arithmetic mode will generate different results.
 Adding "-msse -mfpmath=sse" to CFLAGS will solve this difference.
+On s390, ppc64, and aarch64, gdimagecopyresampled/bug00201 will fail.
+The result is still visually acceptable.
+Adding "-ffp-contract=off" to CFLAGS will solve this difference.

Modified: trunk/Build/source/libs/gd/libgd-src/docs/README.TXT
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/README.TXT	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/README.TXT	2020-04-10 03:40:48 UTC (rev 54636)
@@ -55,7 +55,7 @@
 --with-xpm=DIR
 
   Dto. for xpm library.
-  
+
  --with-tiff=DIR
 
 Dto. for TIFF library.

Modified: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/nobgd.pl
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/nobgd.pl	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/nobgd.pl	2020-04-10 03:40:48 UTC (rev 54636)
@@ -55,4 +55,3 @@
     or die "Error writing file '$filename'\n";
   close ($fh);
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/preamble.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/preamble.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/preamble.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -62,14 +62,14 @@
 >  /* Allocate the color black (red, green and blue all minimum).
 >    Since this is the first color in a new image, it will
 >    be the background color. */
->  black = gdImageColorAllocate(im, 0, 0, 0);  
+>  black = gdImageColorAllocate(im, 0, 0, 0);
 >
 >  /* Allocate the color white (red, green and blue all maximum). */
->  white = gdImageColorAllocate(im, 255, 255, 255);  
->  
+>  white = gdImageColorAllocate(im, 255, 255, 255);
+>
 >  /* Draw a line from the upper left to the lower right,
 >    using white color index. */
->  gdImageLine(im, 0, 0, 63, 63, white);  
+>  gdImageLine(im, 0, 0, 63, 63, white);
 >
 >  /* Open a file for writing. "wb" means "write binary", important
 >    under MSDOS, harmless under Unix. */

Deleted: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Languages.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Languages.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Languages.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,113 +0,0 @@
-Format: 1.52
-
-# This is the Natural Docs languages file for this project.  If you change
-# anything here, it will apply to THIS PROJECT ONLY.  If you'd like to change
-# something for all your projects, edit the Languages.txt in Natural Docs'
-# Config directory instead.
-
-
-# You can prevent certain file extensions from being scanned like this:
-# Ignore Extensions: [extension] [extension] ...
-
-
-#-------------------------------------------------------------------------------
-# SYNTAX:
-#
-# Unlike other Natural Docs configuration files, in this file all comments
-# MUST be alone on a line.  Some languages deal with the # character, so you
-# cannot put comments on the same line as content.
-#
-# Also, all lists are separated with spaces, not commas, again because some
-# languages may need to use them.
-#
-# Language: [name]
-# Alter Language: [name]
-#    Defines a new language or alters an existing one.  Its name can use any
-#    characters.  If any of the properties below have an add/replace form, you
-#    must use that when using Alter Language.
-#
-#    The language Shebang Script is special.  It's entry is only used for
-#    extensions, and files with those extensions have their shebang (#!) lines
-#    read to determine the real language of the file.  Extensionless files are
-#    always treated this way.
-#
-#    The language Text File is also special.  It's treated as one big comment
-#    so you can put Natural Docs content in them without special symbols.  Also,
-#    if you don't specify a package separator, ignored prefixes, or enum value
-#    behavior, it will copy those settings from the language that is used most
-#    in the source tree.
-#
-# Extensions: [extension] [extension] ...
-# [Add/Replace] Extensions: [extension] [extension] ...
-#    Defines the file extensions of the language's source files.  You can
-#    redefine extensions found in the main languages file.  You can use * to
-#    mean any undefined extension.
-#
-# Shebang Strings: [string] [string] ...
-# [Add/Replace] Shebang Strings: [string] [string] ...
-#    Defines a list of strings that can appear in the shebang (#!) line to
-#    designate that it's part of the language.  You can redefine strings found
-#    in the main languages file.
-#
-# Ignore Prefixes in Index: [prefix] [prefix] ...
-# [Add/Replace] Ignored Prefixes in Index: [prefix] [prefix] ...
-#
-# Ignore [Topic Type] Prefixes in Index: [prefix] [prefix] ...
-# [Add/Replace] Ignored [Topic Type] Prefixes in Index: [prefix] [prefix] ...
-#    Specifies prefixes that should be ignored when sorting symbols in an
-#    index.  Can be specified in general or for a specific topic type.
-#
-#------------------------------------------------------------------------------
-# For basic language support only:
-#
-# Line Comments: [symbol] [symbol] ...
-#    Defines a space-separated list of symbols that are used for line comments,
-#    if any.
-#
-# Block Comments: [opening sym] [closing sym] [opening sym] [closing sym] ...
-#    Defines a space-separated list of symbol pairs that are used for block
-#    comments, if any.
-#
-# Package Separator: [symbol]
-#    Defines the default package separator symbol.  The default is a dot.
-#
-# [Topic Type] Prototype Enders: [symbol] [symbol] ...
-#    When defined, Natural Docs will attempt to get a prototype from the code
-#    immediately following the topic type.  It stops when it reaches one of
-#    these symbols.  Use \n for line breaks.
-#
-# Line Extender: [symbol]
-#    Defines the symbol that allows a prototype to span multiple lines if
-#    normally a line break would end it.
-#
-# Enum Values: [global|under type|under parent]
-#    Defines how enum values are referenced.  The default is global.
-#    global       - Values are always global, referenced as 'value'.
-#    under type   - Values are under the enum type, referenced as
-#               'package.enum.value'.
-#    under parent - Values are under the enum's parent, referenced as
-#               'package.value'.
-#
-# Perl Package: [perl package]
-#    Specifies the Perl package used to fine-tune the language behavior in ways
-#    too complex to do in this file.
-#
-#------------------------------------------------------------------------------
-# For full language support only:
-#
-# Full Language Support: [perl package]
-#    Specifies the Perl package that has the parsing routines necessary for full
-#    language support.
-#
-#-------------------------------------------------------------------------------
-
-# The following languages are defined in the main file, if you'd like to alter
-# them:
-#
-#    Text File, Shebang Script, C/C++, C#, Java, JavaScript, Perl, Python,
-#    PHP, SQL, Visual Basic, Pascal, Assembly, Ada, Tcl, Ruby, Makefile,
-#    ActionScript, ColdFusion, R, Fortran
-
-# If you add a language that you think would be useful to other developers
-# and should be included in Natural Docs by default, please e-mail it to
-# languages [at] naturaldocs [dot] org.

Modified: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Menu.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Menu.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Menu.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -27,22 +27,22 @@
 
 
 # --------------------------------------------------------------------------
-# 
+#
 # Cut and paste the lines below to change the order in which your files
 # appear on the menu.  Don't worry about adding or removing files, Natural
 # Docs will take care of that.
-# 
+#
 # You can further organize the menu by grouping the entries.  Add a
 # "Group: [name] {" line to start a group, and add a "}" to end it.
-# 
+#
 # You can add text and web links to the menu by adding "Text: [text]" and
 # "Link: [name] ([URL])" lines, respectively.
-# 
+#
 # The formatting and comments are auto-generated, so don't worry about
 # neatness when editing the file.  Natural Docs will clean it up the next
 # time it is run.  When working with groups, just deal with the braces and
 # forget about the indentation and comments.
-# 
+#
 # --------------------------------------------------------------------------
 
 
@@ -106,4 +106,3 @@
    Macro Index: Macros
    Type Index: Types
    }  # Group: Index
-

Deleted: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Topics.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Topics.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/project/Topics.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,81 +0,0 @@
-Format: 1.52
-
-# This is the Natural Docs topics file for this project.  If you change anything
-# here, it will apply to THIS PROJECT ONLY.  If you'd like to change something
-# for all your projects, edit the Topics.txt in Natural Docs' Config directory
-# instead.
-
-
-# If you'd like to prevent keywords from being recognized by Natural Docs, you
-# can do it like this:
-# Ignore Keywords: [keyword], [keyword], ...
-#
-# Or you can use the list syntax like how they are defined:
-# Ignore Keywords:
-#    [keyword]
-#    [keyword], [plural keyword]
-#    ...
-
-
-#-------------------------------------------------------------------------------
-# SYNTAX:
-#
-# Topic Type: [name]
-# Alter Topic Type: [name]
-#    Creates a new topic type or alters one from the main file.  Each type gets
-#    its own index and behavior settings.  Its name can have letters, numbers,
-#    spaces, and these charaters: - / . '
-#
-# Plural: [name]
-#    Sets the plural name of the topic type, if different.
-#
-# Keywords:
-#    [keyword]
-#    [keyword], [plural keyword]
-#    ...
-#    Defines or adds to the list of keywords for the topic type.  They may only
-#    contain letters, numbers, and spaces and are not case sensitive.  Plural
-#    keywords are used for list topics.  You can redefine keywords found in the
-#    main topics file.
-#
-# Index: [yes|no]
-#    Whether the topics get their own index.  Defaults to yes.  Everything is
-#    included in the general index regardless of this setting.
-#
-# Scope: [normal|start|end|always global]
-#    How the topics affects scope.  Defaults to normal.
-#    normal        - Topics stay within the current scope.
-#    start         - Topics start a new scope for all the topics beneath it,
-#                    like class topics.
-#    end           - Topics reset the scope back to global for all the topics
-#                    beneath it.
-#    always global - Topics are defined as global, but do not change the scope
-#                    for any other topics.
-#
-# Class Hierarchy: [yes|no]
-#    Whether the topics are part of the class hierarchy.  Defaults to no.
-#
-# Page Title If First: [yes|no]
-#    Whether the topic's title becomes the page title if it's the first one in
-#    a file.  Defaults to no.
-#
-# Break Lists: [yes|no]
-#    Whether list topics should be broken into individual topics in the output.
-#    Defaults to no.
-#
-# Can Group With: [type], [type], ...
-#    Defines a list of topic types that this one can possibly be grouped with.
-#    Defaults to none.
-#-------------------------------------------------------------------------------
-
-# The following topics are defined in the main file, if you'd like to alter
-# their behavior or add keywords:
-#
-#    Generic, Class, Interface, Section, File, Group, Function, Variable,
-#    Property, Type, Constant, Enumeration, Event, Delegate, Macro,
-#    Database, Database Table, Database View, Database Index, Database
-#    Cursor, Database Trigger, Cookie, Build Target
-
-# If you add something that you think would be useful to other developers
-# and should be included in Natural Docs by default, please e-mail it to
-# topics [at] naturaldocs [dot] org.

Modified: trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/run_docs.sh
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/run_docs.sh	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/docs/naturaldocs/run_docs.sh	2020-04-10 03:40:48 UTC (rev 54636)
@@ -74,5 +74,3 @@
 
 # And cleanup the temp files.
 rm -rf Data tmp
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,15 +1,19 @@
 include_directories (BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
 
 SET(TESTS_FILES
-  arc
-  crop
-  gif
-  nnquant
-  tgaread
+	gif
 )
 
+if (PNG_FOUND)
+	LIST(APPEND TEST_FILES arc crop tgaread)
+
+	if (JPEG_FOUND)
+		LIST(APPEND TESTS_FILES copyrotated flip nnquant)
+	endif (JPEG_FOUND)
+endif (PNG_FOUND)
+
 if (JPEG_FOUND)
-	LIST(APPEND TESTS_FILES copyrotated flip)
+	LIST(APPEND TESTS_FILES resize)
 endif (JPEG_FOUND)
 
 if (TIFF_FOUND)
@@ -27,12 +31,14 @@
 	target_link_libraries (${test_name} ${GD_LINK_LIB})
 ENDFOREACH(test_name)
 
-if(JPEG_FOUND)
-  if(UNIX)
-    target_link_libraries(copyrotated m)
-  endif(UNIX)
-endif(JPEG_FOUND)
+# Add libraries *after* we've called add_executable on all the tests.
 
+if (PNG_FOUND AND JPEG_FOUND)
+	if (UNIX)
+		target_link_libraries(copyrotated m)
+	endif (UNIX)
+endif(PNG_FOUND AND JPEG_FOUND)
+
 if (WIN32 AND NOT MINGW AND NOT MSYS)
 	add_executable(windows WIN32 "windows.c")
 	target_link_libraries (windows ${GD_LINK_LIB})

Modified: trunk/Build/source/libs/gd/libgd-src/examples/arc.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/arc.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/arc.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -19,11 +18,7 @@
 		gdImageDestroy(im);
 		return 1;
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
-#else
-	printf("No PNG support. Cannot save image.\n");
-#endif
 	fclose(fp);
 
 	gdImageDestroy(im);

Modified: trunk/Build/source/libs/gd/libgd-src/examples/copyrotated.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/copyrotated.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/copyrotated.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -60,9 +59,9 @@
 	/* to radian */
 	a2 = angle * .0174532925;
 
-	new_width = ceil(cos(a2) * gdImageSX(im)) +
+	new_width = fabs(ceil(cos(a2) * gdImageSX(im))) +
 	            fabs(sin(a2) * gdImageSY(im));
-	new_height = ceil(cos(a2) * gdImageSY(im)) +
+	new_height = fabs(ceil(cos(a2) * gdImageSY(im))) +
 	             fabs(sin(a2) * gdImageSX(im));
 
 

Modified: trunk/Build/source/libs/gd/libgd-src/examples/crop.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/crop.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/crop.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,11 +10,7 @@
 		fprintf(stderr, "Can't save png image %s\n", filename);
 		return;
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
-#else
-	printf("No PNG support. Cannot save image.\n");
-#endif
 	fclose(fp);
 }
 
@@ -30,12 +24,7 @@
 		fprintf(stderr, "Can't read png image %s\n", filename);
 		return NULL;
 	}
-#ifdef HAVE_LIBPNG
 	im = gdImageCreateFromPng(fp);
-#else
-	im = NULL;
-	printf("No PNG support. Cannot read image.\n");
-#endif
 	fclose(fp);
 	return im;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/examples/flip.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/flip.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/flip.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>

Modified: trunk/Build/source/libs/gd/libgd-src/examples/gif.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/gif.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/gif.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -49,4 +49,4 @@
 	fclose(out);
 
 	return 0;
-}
\ No newline at end of file
+}

Modified: trunk/Build/source/libs/gd/libgd-src/examples/nnquant.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/nnquant.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/nnquant.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,17 +10,12 @@
 		fprintf(stderr, "Can't save png image %s\n", filename);
 		return;
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
-#else
-	printf("No PNG support. Cannot save image.\n");
-#endif
 	fclose(fp);
 }
 
 int main()
 {
-#ifdef HAVE_JPEG
 	gdImagePtr im, im2;
 	FILE *fp;
 	char path[2048];
@@ -56,9 +49,5 @@
 	save_png(im, "a_jquant_dither.png");
 
 	gdImageDestroy(im);
-#else
-	printf("JPEG support is required for this example. Please recompile GD with JPEG or change this example to use another format as input.");
-	return 1;
-#endif
 	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/examples/resize.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/resize.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/resize.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -56,4 +56,4 @@
 	gdImageDestroy(out);
 
 	return 0;
-}
\ No newline at end of file
+}

Modified: trunk/Build/source/libs/gd/libgd-src/examples/tgaread.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/tgaread.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/tgaread.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 /*
  * You can fetch a set of samples TIFF images here:
  * ftp://ftp.remotesensing.org/pub/libtiff/
@@ -44,11 +43,7 @@
 			gdImageDestroy(im);
 			return 1;
 		}
-#ifdef HAVE_LIBPNG
-	gdImagePng(im, fp);
-#else
-	printf("No PNG support. Cannot save image.\n");
-#endif
+		gdImagePng(im, fp);
 		fclose(fp);
 		gdImageDestroy(im);
 	}

Modified: trunk/Build/source/libs/gd/libgd-src/examples/tiffread.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/tiffread.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/tiffread.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 /*
  * You can fetch a set of samples TIFF images here:
  * ftp://ftp.remotesensing.org/pub/libtiff/

Modified: trunk/Build/source/libs/gd/libgd-src/examples/windows.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/examples/windows.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/examples/windows.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,7 +3,6 @@
 and assigns to a GD truecolor image.
 
 Thanks to Mateusz Loskot (http://mateusz.loskot.net) for the AttachBuffer function!
-$Id$
 */
 #include <windows.h>
 #include <gd.h>

Modified: trunk/Build/source/libs/gd/libgd-src/m4/ax_append_flag.m4
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/m4/ax_append_flag.m4	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/m4/ax_append_flag.m4	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,5 @@
 # ===========================================================================
-#      http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+#      https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -23,33 +23,12 @@
 #   Copyright (c) 2008 Guido U. Draheim <guidod at gmx.de>
 #   Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
 #
-#   This program is free software: you can redistribute it and/or modify it
-#   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation, either version 3 of the License, or (at your
-#   option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-#   Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
 
-#serial 6
+#serial 8
 
 AC_DEFUN([AX_APPEND_FLAG],
 [dnl

Modified: trunk/Build/source/libs/gd/libgd-src/m4/ax_cflags_warn_all.m4
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/m4/ax_cflags_warn_all.m4	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/m4/ax_cflags_warn_all.m4	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,5 @@
 # ===========================================================================
-#    http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
+#    https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -43,7 +43,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -58,7 +58,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 15
+#serial 16
 
 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
 AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl

Modified: trunk/Build/source/libs/gd/libgd-src/m4/ax_pthread.m4
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/m4/ax_pthread.m4	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/m4/ax_pthread.m4	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,5 @@
 # ===========================================================================
-#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+#        https://www.gnu.org/software/autoconf-archive/ax_pthread.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -67,7 +67,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -82,7 +82,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 23
+#serial 24
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [

Modified: trunk/Build/source/libs/gd/libgd-src/m4/ax_require_defined.m4
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/m4/ax_require_defined.m4	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/m4/ax_require_defined.m4	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,5 @@
 # ===========================================================================
-#    http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+#    https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -30,7 +30,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 1
+#serial 2
 
 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
   m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])

Modified: trunk/Build/source/libs/gd/libgd-src/src/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 SET (LIBGD_SRC_FILES
 	bmp.h
 	gd.c
@@ -69,11 +68,19 @@
 	wbmp.h
 )
 
-if(MSVC AND MSVC_VERSION LESS 1900)
-	set(LIBGD_SRC_FILES ${LIBGD_SRC_FILES}
-		snprintf.c
+# Static library just for utility programs.
+SET (GD_PROGRAMS_LIB_SRC_FILES)
+
+if(MSVC)
+	set(GD_PROGRAMS_LIB_SRC_FILES ${GD_PROGRAMS_LIB_SRC_FILES}
+		getopt.c
 	)
-endif(MSVC AND MSVC_VERSION LESS 1900)
+	if(MSVC_VERSION LESS 1900)
+		set(LIBGD_SRC_FILES ${LIBGD_SRC_FILES}
+			snprintf.c
+		)
+	endif(MSVC_VERSION LESS 1900)
+endif(MSVC)
 
 include(GNUInstallDirs)
 
@@ -80,6 +87,8 @@
 if (BUILD_SHARED_LIBS)
 	add_library(${GD_LIB} ${LIBGD_SRC_FILES})
 	set_target_properties(${GD_LIB} PROPERTIES
+		SOVERSION ${GDLIB_LIB_SOVERSION}
+		VERSION ${GDLIB_LIB_VERSION}
 		C_VISIBILITY_PRESET hidden
 		CXX_VISIBILITY_PRESET hidden
 	)
@@ -92,14 +101,24 @@
 	endif()
 endif()
 
+if (NOT "${GD_PROGRAMS_LIB_SRC_FILES}" STREQUAL "")
+	add_library(gd_programs_lib STATIC ${GD_PROGRAMS_LIB_SRC_FILES})
+endif()
+
 if (WIN32 AND NOT MINGW AND NOT MSYS)
   #	SET_TARGET_PROPERTIES(${GD_LIB} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:msvcrt.lib")
-  SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1)
+
+  if (BUILD_STATIC_LIBS)
+    SET_PROPERTY(TARGET ${GD_LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS NONDLL=1)
+  endif()
+
 ENDIF(WIN32 AND NOT MINGW AND NOT MSYS)
 
 if (MINGW OR MSYS)
 	ADD_DEFINITIONS("-mms-bitfields")
-	set_target_properties(${GD_LIB_STATIC} PROPERTIES OUTPUT_NAME ${GD_LIB})
+	if (BUILD_STATIC_LIBS)
+		set_target_properties(${GD_LIB_STATIC} PROPERTIES OUTPUT_NAME ${GD_LIB})
+	endif()
 endif (MINGW OR MSYS)
 
 INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_SOURCE_DIR}/src")
@@ -115,6 +134,7 @@
 	${XPM_LIBRARIES}
 	${FONTCONFIG_LIBRARY}
 	${WEBP_LIBRARIES}
+	${RAQM_LIBRARIES}
 )
 if (BUILD_SHARED_LIBS)
 	target_link_libraries(${GD_LIB} ${LIBGD_DEP_LIBS})
@@ -132,7 +152,7 @@
 	endif()
 endif()
 
-if (FREETYPE_FOUND)
+if (FREETYPE_FOUND AND JPEG_FOUND)
 	set(GD_PROGRAMS ${GD_PROGRAMS} annotate)
 endif()
 
@@ -147,6 +167,9 @@
     else()
         target_link_libraries(${program} ${GD_LIB_STATIC})
     endif()
+	if (NOT "${GD_PROGRAMS_LIB_SRC_FILES}" STREQUAL "")
+		target_link_libraries(${program} gd_programs_lib)
+	endif()
 endforeach(program)
 
 set(GD_INSTALL_TARGETS ${GD_PROGRAMS})
@@ -177,3 +200,6 @@
 	gdfx.h
 	gdpp.h
 	DESTINATION include)
+
+CONFIGURE_FILE(../config/gdlib.pc.cmake gdlib.pc @ONLY)
+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/gdlib.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

Modified: trunk/Build/source/libs/gd/libgd-src/src/COPYING
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/COPYING	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/COPYING	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,25 +1,24 @@
- 
      Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
      2002 by Cold Spring Harbor Laboratory. Funded under Grant
-     P41-RR02188 by the National Institutes of Health. 
+     P41-RR02188 by the National Institutes of Health.
 
      Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
-     Boutell.Com, Inc. 
+     Boutell.Com, Inc.
 
      Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
      Philip Warner.
-     
+
      Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
-     Roelofs. 
+     Roelofs.
 
-     Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John  
+     Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John
      Ellson (ellson at lucent.com).
-   
-     Portions relating to gdft.c copyright 2001, 2002 John Ellson  
-     (ellson at lucent.com).  
 
+     Portions relating to gdft.c copyright 2001, 2002 John Ellson
+     (ellson at lucent.com).
+
      Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-		 2008 Pierre-Alain Joye (pierre at libgd.org).  
+		 2008 Pierre-Alain Joye (pierre at libgd.org).
 
      Portions relating to JPEG and to color quantization copyright 2000,
      2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
@@ -35,19 +34,18 @@
      provided that this notice is present in user-accessible supporting
      documentation.
 
-     This does not affect your ownership of the derived work itself, and 
+     This does not affect your ownership of the derived work itself, and
      the intent is to assure proper credit for the authors of gd, not to
      interfere with your productive use of gd. If you have questions,
-     ask. "Derived works" includes all programs that utilize the   
+     ask. "Derived works" includes all programs that utilize the
      library. Credit must be given in user-accessible documentation.
 
-     This software is provided "AS IS." The copyright holders disclaim  
+     This software is provided "AS IS." The copyright holders disclaim
      all warranties, either express or implied, including but not
      limited to implied warranties of merchantability and fitness for a
-     particular purpose, with respect to this code and accompanying  
+     particular purpose, with respect to this code and accompanying
      documentation.
 
      Although their code does not appear in gd, the authors wish to thank
      David Koblas, David Rowley, and Hutchison Avenue Software Corporation
      for their prior contributions.
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/Makefile.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/Makefile.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/Makefile.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -23,7 +23,9 @@
 endif
 
 if HAVE_LIBFREETYPE
+if HAVE_LIBJPEG
 bin_PROGRAMS += annotate
+endif
 check_PROGRAMS += gdtestft testtr
 endif
 
@@ -37,7 +39,19 @@
 check_PROGRAMS += gd2time
 endif
 
-EXTRA_DIST = bdftogd demoin.png entities.html entities.tcl CMakeLists.txt config.h.cmake gd_io_stream.cxx gdpp.cxx msinttypes/inttypes.h msinttypes/stdint.h
+EXTRA_DIST = \
+	bdftogd \
+	demoin.png \
+	entities.html \
+	entities.tcl \
+	CMakeLists.txt \
+	config.h.cmake \
+	gd_io_stream.cxx \
+	gdpp.cxx \
+	getopt.c \
+	snprintf.c \
+	msinttypes/inttypes.h \
+	msinttypes/stdint.h
 
 include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h entities.h gd_color_map.h gd_errors.h gdpp.h
 
@@ -114,4 +128,3 @@
 libgd_la_LIBADD = $(LTLIBICONV)
 
 LDADD = libgd.la $(LIBICONV)
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/annotate.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/annotate.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/annotate.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -16,31 +16,21 @@
 
 int main(int argc, char *argv[])
 {
-#ifndef HAVE_LIBFREETYPE
-	(void)argc;
-	(void)argv;
-
-	/* 2.0.12 */
-	fprintf(stderr, "annotate is not useful without freetype.\n"
-	         "Install freetype, then './configure; make clean; make install'\n"
-	         "the gd library again.\n"
-	        );
-	return 1;
-#else
 	gdImagePtr im;
 	char *iin, *iout;
 	FILE *in, *out;
-	char s[1024];
+	char *s;
+	size_t len;
 	int bounds[8];
 	int lines = 1;
 	int color = gdTrueColor(0, 0, 0);
-	char font[1024];
+	char *font;
 	int size = 12;
 	int align = left;
 	int x = 0, y = 0;
 	char *fontError;
 
-	strcpy(font, "times");
+	font = strdup("times");
 
 	if(argc != 3) {
 		fprintf(stderr, "Usage: annotate imagein.jpg imageout.jpg\n\n");
@@ -47,7 +37,7 @@
 		fprintf(stderr, "Standard input should consist of\n");
 		fprintf(stderr, "lines in the following formats:\n");
 		fprintf(stderr, "color r g b (0-255 each) [a (0-127, 0 is opaque)]\n");
-		fprintf(stderr, "font fontname (max name length 1024)\n");
+		fprintf(stderr, "font fontname\n");
 		fprintf(stderr, "size pointsize\n");
 		fprintf(stderr, "align (left|right|center)\n");
 		fprintf(stderr, "move x y\n");
@@ -70,12 +60,7 @@
 		exit(2);
 	}
 
-#ifdef HAVE_LIBJPEG
 	im = gdImageCreateFromJpeg(in);
-#else
-	fprintf(stderr, "No JPEG library support available.\n");
-	exit(1);
-#endif
 
 	fclose(in);
 
@@ -84,7 +69,9 @@
 		exit(3);
 	}
 
-	while(fgets(s, sizeof(s), stdin)) {
+	s = NULL;
+	len = 0;
+	while (getline(&s, &len, stdin) != -1) {
 		char *st;
 		char *text;
 
@@ -99,12 +86,12 @@
 			if(!st) {
 				goto badLine;
 			} else {
-				const unsigned int font_len = strlen(st);
-				if (font_len >= 1024) {
-					fprintf(stderr, "Font maximum length is 1024, %d given\n", font_len);
+				free(font);
+				font = strdup(st);
+				if (font == NULL) {
+					perror("Font failed");
 					goto badLine;
 				}
-				strncpy(font, st, font_len);
 			}
 		} else if(!strcmp(st, "align")) {
 			char *st = strtok(0, " \t\r\n");
@@ -178,7 +165,7 @@
 
 			fontError = gdImageStringFT(im, 0, color, font, size, 0, rx, y, text);
 			if(fontError) {
-				fprintf(stderr, "font error at line %d: %s\n", lines, fontError);
+				fprintf(stderr, "Font error at line %d: %s\n", lines, fontError);
 				exit(7);
 			}
 
@@ -194,6 +181,8 @@
 		fprintf(stderr, "Bad syntax, line %d\n", lines);
 		exit(4);
 	}
+	free(font);
+	free(s);
 
 	out = fopen(iout, "wb");
 	if(!out) {
@@ -200,13 +189,8 @@
 		fprintf(stderr, "Cannot create %s\n", iout);
 		exit(5);
 	}
-#ifdef HAVE_LIBJPEG
 	gdImageJpeg(im, out, 95);
-#else
-	fprintf(stderr, "No JPEG library support available.\n");
-#endif
 	gdImageDestroy(im);
 	fclose(out);
 	return 0;
-#endif /* HAVE_LIBFREETYPE */
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/bdftogd
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/bdftogd	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/bdftogd	2020-04-10 03:40:48 UTC (rev 54636)
@@ -46,19 +46,19 @@
 	my ($tag, $value) = split / /, $_, 2;
 	die "Font is not fixed width\n"
 			if $tag eq 'SPACING' and not $value =~ /[CM]/i;
-	
+
 	$currentchar = $value if $tag eq 'ENCODING';
 	$minchar = $currentchar if not defined $minchar
 		or $currentchar < $minchar;
 	$maxchar = $currentchar if not defined $maxchar
 		or $currentchar > $maxchar;
-	
+
 	if ($tag eq 'ENDCHAR')
 		{
 		$gobitmap = 0;
 		my $bottom = $globaltop - $bottom[$currentchar];
-		
 
+
 		if ($bottom > 0)
 			{ $data[$currentchar] = substr $data[$currentchar], 0, length($data[$currentchar]) - $bottom * $width; }
 		else
@@ -80,7 +80,7 @@
 		{ $fontdef = $value; }
 	if ($tag eq 'COPYRIGHT' and not defined $copyright)
 		{ $copyright = $value; }
-	
+
 	if ($tag eq 'BBX')
 		{
 		my ($tag, $wid, $hei, $left, $bottom) = split / /;
@@ -100,7 +100,7 @@
 		$bits = substr $bits, 0, $width;
 		$data[$currentchar] .= $bits;
 		}
-	
+
 	if ($tag eq 'BITMAP')
 		{
 		$gobitmap = 1;
@@ -150,7 +150,7 @@
 	{
 	$data[$i] = '' unless defined $data[$i];
 	$data[$i] = '0' x ($width * $height - length $data[$i]) . $data[$i];
-	
+
 	print FILEC "/* Char $i */\n";
 	for my $line (0 .. $height - 1)
 		{ print FILEC join ',', split(//, substr($data[$i], $line * $width, $width)), "\n"; }
@@ -158,7 +158,7 @@
 	print FILEC "\n";
 
 	next;
-	
+
 	for my $line (0 .. $height - 1)
 		{ print substr($data[$i], $line * $width, $width), "\n"; }
 	}
@@ -202,4 +202,3 @@
 EOF
 
 1;
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/bmp.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/bmp.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/bmp.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,6 @@
-/* $Id$ */
+#ifndef BMP_H
+#define BMP_H	1
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -19,9 +21,6 @@
 		----------------------------------------------------------------------------
 	 */
 
-#ifndef BMP_H
-#define BMP_H	1
-
 #define BMP_PALETTE_3 1
 #define BMP_PALETTE_4 2
 
@@ -105,8 +104,8 @@
 
 	} bmp_info_t;
 
-#endif
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/circletexttest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/circletexttest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/circletexttest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,10 +8,6 @@
 int main(void)
 {
 	/* 2.0.22: can't depend on PNG either  */
-#ifndef HAVE_LIBPNG
-	fprintf(stderr, "Requires PNG support, gd was compiled without it\n");
-	return 0;
-#else
 	char *error;
 #ifdef HAVE_LIBJPEG
 	FILE *in = 0;
@@ -64,6 +60,5 @@
 	gdImagePng(im, out);
 	fclose(out);
 	gdImageDestroy(im);
-#endif /* HAVE_LIBPNG */
 	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/config.h.cmake
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/config.h.cmake	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/config.h.cmake	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,6 +3,9 @@
 /* Define is you are building for Win32 API */
 #cmakedefine BGDWIN32
 
+/* Whether to support gd image formats */
+#define ENABLE_GD_FORMATS @ENABLE_GD_FORMATS@
+
 /* Define to 1 if you have the <dirent.h> header file. */
 #cmakedefine HAVE_DIRENT_H
 
@@ -9,9 +12,6 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #cmakedefine HAVE_DLFCN_H
 
-/* Define to 1 if you have the <errno.h> header file. */
-#cmakedefine HAVE_ERRNO_H
-
 /* Define if you have the ft2build.h header. */
 #cmakedefine HAVE_FT2BUILD_H
 
@@ -45,6 +45,9 @@
 /* Define if you have png */
 #cmakedefine HAVE_LIBPNG
 
+/* Define if you have raqm */
+#cmakedefine HAVE_LIBRAQM
+
 /* Define if you have tiff */
 #cmakedefine HAVE_LIBTIFF
 
@@ -57,9 +60,6 @@
 /* Define if you have zlib */
 #cmakedefine HAVE_LIBZ
 
-/* Define to 1 if you have the <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H
-
 /* Define to 1 if you have the <memory.h> header file. */
 #cmakedefine HAVE_MEMORY_H
 
@@ -72,21 +72,12 @@
 /* Have PTHREAD_PRIO_INHERIT. */
 #cmakedefine HAVE_PTHREAD_PRIO_INHERIT
 
-/* Define to 1 if you have the <stddef.h> header file. */
-#cmakedefine HAVE_STDDEF_H
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #cmakedefine HAVE_STDINT_H
 
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
 /* Define to 1 if you have the <strings.h> header file. */
 #cmakedefine HAVE_STRINGS_H
 
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #cmakedefine HAVE_SYS_STAT_H
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/config.hin
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/config.hin	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/config.hin	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,6 +3,9 @@
 /* Define is you are building for Win32 API */
 #undef BGDWIN32
 
+/* Whether to support gd image formats */
+#undef ENABLE_GD_FORMATS
+
 /* Define to 1 if you have the <dirent.h> header file. */
 #undef HAVE_DIRENT_H
 
@@ -9,9 +12,6 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
 /* Define if you have the ft2build.h header. */
 #undef HAVE_FT2BUILD_H
 
@@ -45,6 +45,9 @@
 /* Define if you have png */
 #undef HAVE_LIBPNG
 
+/* Define if you have raqm */
+#undef HAVE_LIBRAQM
+
 /* Define if you have tiff */
 #undef HAVE_LIBTIFF
 
@@ -57,9 +60,6 @@
 /* Define if you have zlib */
 #undef HAVE_LIBZ
 
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -72,9 +72,6 @@
 /* Have PTHREAD_PRIO_INHERIT. */
 #undef HAVE_PTHREAD_PRIO_INHERIT
 
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/entities.html
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/entities.html	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/entities.html	2020-04-10 03:40:48 UTC (rev 54636)
@@ -11,7 +11,7 @@
 <body>
 <div class="navbar" align="center"> <a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html">
 previous</a>   <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a>   <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc">contents</a>   <a href="http://www.w3.org/TR/REC-html40/index/elements.html">
-elements</a>   <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a>   <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a> 
+elements</a>   <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a>   <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a>
 
 <hr></div>
 
@@ -26,7 +26,7 @@
 references</a></li>
 
 <li><a class="tocxref" href="#h-24.2">Character entity references for ISO
-8859-1 characters</a> 
+8859-1 characters</a>
 
 <ol>
 <li><a class="tocxref" href="#h-24.2.1">The list of characters</a></li>
@@ -34,7 +34,7 @@
 </li>
 
 <li><a class="tocxref" href="#h-24.3">Character entity references for symbols,
-mathematical symbols, and Greek letters</a> 
+mathematical symbols, and Greek letters</a>
 
 <ol>
 <li><a class="tocxref" href="#h-24.3.1">The list of characters</a></li>
@@ -42,7 +42,7 @@
 </li>
 
 <li><a class="tocxref" href="#h-24.4">Character entity references for
-markup-significant and internationalization characters</a> 
+markup-significant and internationalization characters</a>
 
 <ol>
 <li><a class="tocxref" href="#h-24.4.1">The list of characters</a></li>
@@ -55,7 +55,7 @@
 
 A <a href="http://www.w3.org/TR/REC-html40/charset.html#entities">character entity reference</a> is an SGML
 construct that references a character of the <a href="http://www.w3.org/TR/REC-html40/charset.html">document
-character set.</a> 
+character set.</a>
 
 <p>This version of HTML supports several sets of character entity
 references:</p>
@@ -345,7 +345,7 @@
      existing ISO 8879 entity names. ISO 10646 character numbers
      are given for each character, in hex. CDATA values are decimal
      conversions of the ISO 10646 values and refer to the document
-     character set. Names are ISO 10646 names. 
+     character set. Names are ISO 10646 names.
 
 -->
 
@@ -472,7 +472,7 @@
 <!ENTITY uArr     CDATA "&#8657;" -- upwards double arrow, U+21D1 ISOamsa -->
 <!ENTITY rArr     CDATA "&#8658;" -- rightwards double arrow,
                                      U+21D2 ISOtech -->
-<!-- ISO 10646 does not say this is the 'implies' character but does not have 
+<!-- ISO 10646 does not say this is the 'implies' character but does not have
      another character with this function so ?
      rArr can be used for 'implies' as ISOtech suggests -->
 <!ENTITY dArr     CDATA "&#8659;" -- downwards double arrow, U+21D3 ISOamsa -->
@@ -525,9 +525,9 @@
                                      U+2265 ISOtech -->
 <!ENTITY sub      CDATA "&#8834;" -- subset of, U+2282 ISOtech -->
 <!ENTITY sup      CDATA "&#8835;" -- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol 
+<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
      font encoding and is not included. Should it be, for symmetry?
-     It is in ISOamsn  --> 
+     It is in ISOamsn  -->
 <!ENTITY nsub     CDATA "&#8836;" -- not a subset of, U+2284 ISOamsn -->
 <!ENTITY sube     CDATA "&#8838;" -- subset of or equal to, U+2286 ISOtech -->
 <!ENTITY supe     CDATA "&#8839;" -- superset of or equal to,
@@ -550,11 +550,11 @@
 <!ENTITY rfloor   CDATA "&#8971;" -- right floor, U+230B ISOamsc  -->
 <!ENTITY lang     CDATA "&#9001;" -- left-pointing angle bracket = bra,
                                      U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than' 
+<!-- lang is NOT the same character as U+003C 'less than'
      or U+2039 'single left-pointing angle quotation mark' -->
 <!ENTITY rang     CDATA "&#9002;" -- right-pointing angle bracket = ket,
                                      U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than' 
+<!-- rang is NOT the same character as U+003E 'greater than'
      or U+203A 'single right-pointing angle quotation mark' -->
 
 <!-- Geometric Shapes -->
@@ -614,7 +614,7 @@
      existing ISO 8879 entity names. ISO 10646 character numbers
      are given for each character, in hex. CDATA values are decimal
      conversions of the ISO 10646 values and refer to the document
-     character set. Names are ISO 10646 names. 
+     character set. Names are ISO 10646 names.
 
 -->
 
@@ -679,4 +679,4 @@
 <div class="navbar" align="center">
 <hr><a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html">previous</a>   <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a>   <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc">
 contents</a>   <a href="http://www.w3.org/TR/REC-html40/index/elements.html">elements</a>   <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a>   <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a></div>
-</body></html>
\ No newline at end of file
+</body></html>

Modified: trunk/Build/source/libs/gd/libgd-src/src/fontconfigtest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/fontconfigtest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/fontconfigtest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -9,7 +9,6 @@
 	gdImagePtr im;
 	int green, blue;
 	gdFTStringExtra se;
-	FILE *out;
 	im = gdImageCreateTrueColor(300, 100);
 	green = gdImageColorAllocate(im, 128, 255, 128);
 	gdImageFilledRectangle(im, 0, 0, 300, 100, green);
@@ -33,7 +32,7 @@
 	gdImageStringFTEx(im, 0, blue, "arial",
 	                  12, 0, 20, 80, "plain pathname", &se);
 #ifdef HAVE_LIBPNG
-	out = fopen("fontconfigtest.png", "wb");
+	FILE *out = fopen("fontconfigtest.png", "wb");
 	gdImagePng(im, out);
 	fclose(out);
 #else
@@ -41,4 +40,3 @@
 #endif /* HAVE_LIBPNG */
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/fontsizetest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/fontsizetest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/fontsizetest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -19,29 +18,17 @@
 		sprintf (buf, "%d: %s", cursize, string);
 
 		/* The case of newlines is taken care of in the gdImageStringTTF call */
-#if defined(OLDER_GD)
 		cp =
-		    gdImageStringTTF (im, brect, color, fontfile, cursize, curang, x, y,
-		                      buf);
-#else
-		cp =
 		    gdImageStringFT (im, brect, color, fontfile, cursize, curang, x, y,
 		                     buf);
-#endif
 		if (cp)
 			fprintf(stderr, "%s\n", cp);
 		y += cursize + 4;
 
 		/* render the same fontsize with antialiasing turned off */
-#if defined(OLDER_GD)
 		cp =
-		    gdImageStringTTF (im, brect, 0 - color, fontfile, cursize, curang, x,
-		                      y, buf);
-#else
-		cp =
 		    gdImageStringFT (im, brect, 0 - color, fontfile, cursize, curang, x,
 		                     y, buf);
-#endif
 		if (cp)
 			fprintf(stderr, "%s\n", cp);
 		y += cursize + 4;

Modified: trunk/Build/source/libs/gd/libgd-src/src/fontwheeltest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/fontwheeltest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/fontwheeltest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -37,13 +36,8 @@
 		y0 = y - sin (curangrads) * offset;
 
 		/* The case of newlines is taken care of in the gdImageStringTTF call */
-#if defined(OLDER_GD)
-		cp = gdImageStringTTF (im, brect, color, fontfile, fontsize,
-		                       curangrads, x0, y0, string);
-#else
 		cp = gdImageStringFT (im, brect, color, fontfile, fontsize,
 		                      curangrads, x0, y0, string);
-#endif
 		if (cp)
 			doerr (err, cp);
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #include <stdio.h>
 #include <math.h>
 #include <string.h>
@@ -177,7 +175,7 @@
 
     See Also:
 
-        <gdImageCreateTrueColor>        
+        <gdImageCreateTrueColor>
 
  */
 BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy)
@@ -192,7 +190,7 @@
 	if (overflow2(sizeof (unsigned char *), sy)) {
 		return NULL;
 	}
-	if (overflow2(sizeof (unsigned char *), sx)) {
+	if (overflow2(sizeof (unsigned char), sx)) {
 		return NULL;
 	}
 
@@ -285,7 +283,7 @@
 
     See Also:
 
-        <gdImageCreateTrueColor>        
+        <gdImageCreateTrueColor>
 
 */
 BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy)
@@ -296,12 +294,10 @@
 	if (overflow2(sx, sy)) {
 		return NULL;
 	}
-
 	if (overflow2(sizeof (int *), sy)) {
 		return 0;
 	}
-
-	if (overflow2(sizeof(int *), sx)) {
+	if (overflow2(sizeof(int), sx)) {
 		return NULL;
 	}
 
@@ -418,7 +414,7 @@
 
 /**
  * Function: gdImageColorClosest
- * 
+ *
  * Gets the closest color of the image
  *
  * This is a simplified variant of <gdImageColorClosestAlpha> where the alpha
@@ -910,15 +906,13 @@
 	}
 
 	if (!im->trueColor) {
-		if((color < -1) || (color >= gdMaxColors)) {
+		if (color >= gdMaxColors) {
 			return;
 		}
 		if (im->transparent != -1) {
 			im->alpha[im->transparent] = gdAlphaOpaque;
 		}
-		if (color != -1) {
-			im->alpha[color] = gdAlphaTransparent;
-		}
+		im->alpha[color] = gdAlphaTransparent;
 	}
 	im->transparent = color;
 }
@@ -1491,7 +1485,7 @@
 
 /*
 	Function: gdImageAABlend
-	
+
 	NO-OP, kept for library compatibility.
 */
 BGD_DECLARE(void) gdImageAABlend (gdImagePtr im)
@@ -1544,7 +1538,7 @@
 
 /*
 	Function: gdImageLine
-	
+
 	Bresenham as presented in Foley & Van Dam.
 */
 BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
@@ -1589,7 +1583,7 @@
 	if (dy <= dx) {
 		/* More-or-less horizontal. use wid for vertical stroke */
 		/* Doug Claar: watch out for NaN in atan2 (2.0.5) */
-		
+
 		/* 2.0.12: Michael Schwartz: divide rather than multiply;
 			  TBB: but watch out for /0! */
 		double ac = cos (atan2 (dy, dx));
@@ -1942,7 +1936,7 @@
 
 /**
  * Function: gdImageString
- * 
+ *
  * Draws a character string.
  *
  * Parameters:
@@ -2068,6 +2062,7 @@
 	int i, pti;
 	int lx = 0, ly = 0;
 	int fx = 0, fy = 0;
+	int startx = -1, starty = -1, endx = -1, endy = -1;
 
 	if ((s % 360)  == (e % 360)) {
 		s = 0;
@@ -2097,8 +2092,8 @@
 
 	for (i = s, pti = 1; (i <= e); i++, pti++) {
 		int x, y;
-		x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
-		y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy;
+		x = endx = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
+		y = endy = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy;
 		if (i != s) {
 			if (!(style & gdChord)) {
 				if (style & gdNoFill) {
@@ -2124,8 +2119,8 @@
 			if (!(style & (gdChord | gdNoFill))) {
 				pts[0].x = cx;
 				pts[0].y = cy;
-				pts[pti].x = x;
-				pts[pti].y = y;
+				pts[pti].x = startx = x;
+				pts[pti].y = starty = y;
 			}
 		}
 		lx = x;
@@ -2154,6 +2149,24 @@
 				gdImageLine (im, cx, cy, fx, fy, color);
 			}
 		} else {
+			if (e - s < 360) {
+				if (pts[1].x != startx && pts[1].y == starty) {
+					/* start point has been removed due to y-coord fix => insert it */
+					for (i = pti; i > 1; i--) {
+						pts[i].x = pts[i-1].x;
+						pts[i].y = pts[i-1].y;
+					}
+					pts[1].x = startx;
+					pts[1].y = starty;
+					pti++;
+				}
+				if (pts[pti-1].x != endx && pts[pti-1].y == endy) {
+					/* end point has been removed due to y-coord fix => insert it */
+					pts[pti].x = endx;
+					pts[pti].y = endy;
+					pti++;
+				}
+			}
 			pts[pti].x = cx;
 			pts[pti].y = cy;
 			gdImageFilledPolygon(im, pts, pti+1, color);
@@ -2167,7 +2180,7 @@
 BGD_DECLARE(void) gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
 {
 	int x=0,mx1=0,mx2=0,my1=0,my2=0;
-	long aq,bq,dx,dy,r,rx,ry,a,b;
+	int64_t aq,bq,dx,dy,r,rx,ry,a,b;
 
 	a=w>>1;
 	b=h>>1;
@@ -2214,7 +2227,7 @@
 BGD_DECLARE(void) gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c)
 {
 	int x=0,mx1=0,mx2=0,my1=0,my2=0;
-	long aq,bq,dx,dy,r,rx,ry,a,b;
+	int64_t aq,bq,dx,dy,r,rx,ry,a,b;
 	int i;
 	int old_y2;
 
@@ -2281,7 +2294,7 @@
 	}
 
 	if (!im->trueColor) {
-		if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) {
+		if (color > (im->colorsTotal - 1) || border > (im->colorsTotal - 1)) {
 			return;
 		}
 	}
@@ -2301,7 +2314,7 @@
 	} else if (y < 0) {
 		y = 0;
 	}
-	
+
 	for (i = x; (i >= 0); i--) {
 		if (gdImageGetPixel (im, i, y) == border) {
 			break;
@@ -2616,16 +2629,12 @@
  *
  * Parameters:
  *   im    - The image.
- *   x1    - The x-coordinate of the upper left corner.
- *   y1    - The y-coordinate of the upper left corner.
- *   x2    - The x-coordinate of the lower right corner.
- *   y2    - The y-coordinate of the lower right corner.
+ *   x1    - The x-coordinate of one of the corners.
+ *   y1    - The y-coordinate of one of the corners.
+ *   x2    - The x-coordinate of another corner.
+ *   y2    - The y-coordinate of another corner.
  *   color - The color.
  *
- * Note that x1,y1 and x2,y2 may be swapped, i.e. the former may designate the
- * lower right corner and the latter the upper left corner. The behavior for
- * specifying other corners is undefined.
- *
  * See also:
  *   - <gdImageFilledRectangle>
  */
@@ -2639,12 +2648,13 @@
 	}
 
 	if (y2 < y1) {
-		int t;
-		t = y1;
+		int t = y1;
 		y1 = y2;
 		y2 = t;
+	}
 
-		t = x1;
+	if (x2 < x1) {
+		int t = x1;
 		x1 = x2;
 		x2 = t;
 	}
@@ -2855,14 +2865,6 @@
 		}
 	}
 
-	if (src->styleLength > 0) {
-		dst->styleLength = src->styleLength;
-		dst->stylePos    = src->stylePos;
-		for (i = 0; i < src->styleLength; i++) {
-			dst->style[i] = src->style[i];
-		}
-	}
-
 	dst->interlace   = src->interlace;
 
 	dst->alphaBlendingFlag = src->alphaBlendingFlag;
@@ -2897,6 +2899,7 @@
 
 	if (src->style) {
 		gdImageSetStyle(dst, src->style, src->styleLength);
+		dst->stylePos = src->stylePos;
 	}
 
 	for (i = 0; i < gdMaxColors; i++) {
@@ -3099,7 +3102,7 @@
  * Note:
  *   This function is a substitute for real alpha channel operations,
  *   so it doesn't pay attention to the alpha channel.
- * 
+ *
  * Parameters:
  *   dst  - The destination image.
  *   src  - The source image.
@@ -3180,7 +3183,7 @@
  *
  * If the source and destination area differ in size, the area will be resized
  * using nearest-neighbor interpolation.
- * 
+ *
  * Parameters:
  *   dst  - The destination image.
  *   src  - The source image.
@@ -3437,7 +3440,7 @@
  * If the source and destination area differ in size, the area will be resized
  * using bilinear interpolation for truecolor images, and nearest-neighbor
  * interpolation for palette images.
- * 
+ *
  * Parameters:
  *   dst  - The destination image.
  *   src  - The source image.
@@ -4345,8 +4348,8 @@
 	/* keep them as 32bits */
 	long x, y, inc, frac;
 	long dx, dy,tmp;
-	int w, wid, wstart; 
-	int thick = im->thick; 
+	int w, wid, wstart;
+	int thick = im->thick;
 
 	if (!im->trueColor) {
 		/* TBB: don't crash when the image is of the wrong type */
@@ -4365,7 +4368,7 @@
 
 	if (dx == 0 && dy == 0) {
 		/* TBB: allow setting points */
-		gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
+		gdImageSetPixel(im, x1, y1, col);
 		return;
 	} else {
 		double ag;

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,20 +1,20 @@
+#ifndef GD_H
+#define GD_H 1
+
+#include <stdlib.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <stdlib.h>
-
-#ifndef GD_H
-#define GD_H 1
-
 /* Version information.  This gets parsed by build scripts as well as
  * gcc so each #define line in this group must also be splittable on
  * whitespace, take the form GD_*_VERSION and contain the magical
  * trailing comment. */
 #define GD_MAJOR_VERSION    2           /*version605b5d1778*/
-#define GD_MINOR_VERSION    2           /*version605b5d1778*/
-#define GD_RELEASE_VERSION  5           /*version605b5d1778*/
-#define GD_EXTRA_VERSION    ""          /*version605b5d1778*/
+#define GD_MINOR_VERSION    3           /*version605b5d1778*/
+#define GD_RELEASE_VERSION  0           /*version605b5d1778*/
+#define GD_EXTRA_VERSION    ""      /*version605b5d1778*/
 /* End parsable section. */
 
 /* The version string.  This is constructed from the version number
@@ -29,7 +29,7 @@
                       GDXXX_STR(GD_RELEASE_VERSION),                    \
                       GD_EXTRA_VERSION)
 
-    
+
 /* Do the DLL dance: dllexport when building the DLL,
    dllimport when importing from it, nothing when
    not on Silly Silly Windows (tm Aardman Productions). */
@@ -51,7 +51,7 @@
 #   define BGD_EXPORT_DATA_PROT
 #  else
 #   ifdef __GNUC__
-#    define BGD_EXPORT_DATA_PROT __attribute__ ((dllexport))
+#    define BGD_EXPORT_DATA_PROT __attribute__ ((__dllexport__))
 #   else
 #    define BGD_EXPORT_DATA_PROT __declspec(dllexport)
 #   endif
@@ -58,7 +58,7 @@
 #  endif
 # else
 #  ifdef __GNUC__
-#   define BGD_EXPORT_DATA_PROT __attribute__ ((dllimport))
+#   define BGD_EXPORT_DATA_PROT __attribute__ ((__dllimport__))
 #  else
 #   define BGD_EXPORT_DATA_PROT __declspec(dllimport)
 #  endif
@@ -67,8 +67,8 @@
 # define BGD_EXPORT_DATA_IMPL
 #else
 # if defined(__GNUC__) || defined(__clang__)
-#  define BGD_EXPORT_DATA_PROT __attribute__ ((visibility ("default")))
-#  define BGD_EXPORT_DATA_IMPL __attribute__ ((visibility ("hidden")))
+#  define BGD_EXPORT_DATA_PROT __attribute__ ((__visibility__ ("default")))
+#  define BGD_EXPORT_DATA_IMPL __attribute__ ((__visibility__ ("hidden")))
 # else
 #  define BGD_EXPORT_DATA_PROT
 #  define BGD_EXPORT_DATA_IMPL
@@ -79,24 +79,19 @@
 #define BGD_DECLARE(rt) BGD_EXPORT_DATA_PROT rt BGD_STDCALL
 
 /* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set
-   We define inline, snprintf, and strcasecmp if they're missing 
+   We define inline, snprintf, and strcasecmp if they're missing
 */
 #ifdef _MSC_VER
 #  define _ALLOW_KEYWORD_MACROS
 #  ifndef inline
 #    define inline __inline
-#  endif 
+#  endif
 #  ifndef strcasecmp
 #    define strcasecmp _stricmp
-#  endif 
+#  endif
 #if _MSC_VER < 1900
      extern int snprintf(char*, size_t, const char*, ...);
 #endif
-#endif 
-
-#ifdef __cplusplus
-	extern "C"
-	{
 #endif
 
 /* gd.h: declarations file for the graphic-draw module.
@@ -131,9 +126,9 @@
    must be 32 bits wide or more.
 
    True colors are repsented as follows:
-   
+
    ARGB
-	
+
    Where 'A' (alpha channel) occupies only the
    LOWER 7 BITS of the MSB. This very small
    loss of alpha channel resolution allows gd 2.x
@@ -209,7 +204,7 @@
  * Group: Effects
  *
  * The layering effect
- * 
+ *
  * When pixels are drawn the new colors are "mixed" with the background
  * depending on the effect.
  *
@@ -286,7 +281,7 @@
  *
  *  GD_BELL				 - Bell
  *  GD_BESSEL			 - Bessel
- *  GD_BILINEAR_FIXED 	 - fixed point bilinear 
+ *  GD_BILINEAR_FIXED 	 - fixed point bilinear
  *  GD_BICUBIC 			 - Bicubic
  *  GD_BICUBIC_FIXED 	 - fixed point bicubic integer
  *  GD_BLACKMAN			 - Blackman
@@ -346,7 +341,7 @@
 
 /*
    Group: Types
- 
+
    typedef: gdImage
 
    typedef: gdImagePtr
@@ -513,7 +508,7 @@
   structure.
 
   Please see the files gdfontl.c and gdfontl.h for an example of
-  the proper declaration of this structure. 
+  the proper declaration of this structure.
 
   > typedef struct {
   >   // # of characters in font
@@ -710,7 +705,7 @@
    alpha channel value of 'color'; default is to overwrite.
    Tiling and line styling are also implemented
    here. All other gd drawing functions pass through this call,
-   allowing for many useful effects. 
+   allowing for many useful effects.
    Overlay and multiply effects are used when gdImageAlphaBlending
    is passed gdEffectOverlay and gdEffectMultiply */
 
@@ -768,14 +763,14 @@
 BGD_DECLARE(void) gdFreeFontCache (void);
 
 /* Calls gdImageStringFT. Provided for backwards compatibility only. */
-BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist,
+BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, const char *fontlist,
                                       double ptsize, double angle, int x, int y,
-                                      char *string);
+                                      const char *string);
 
 /* FreeType 2 text output */
-BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
+BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, const char *fontlist,
                                      double ptsize, double angle, int x, int y,
-                                     char *string);
+                                     const char *string);
 
 
 /*
@@ -808,7 +803,7 @@
 				    then, on return, xshow is a malloc'ed
 				    string containing xshow position data for
 				    the last string.
-				    
+
 				    NB. The caller is responsible for gdFree'ing
 				    the xshow string.
 				 */
@@ -817,7 +812,7 @@
 				    string containing the actual font file path name
 				    used, which can be interesting when fontconfig
 				    is in use.
-				    
+
 				    The caller is responsible for gdFree'ing the
 				    fontpath string.
 				 */
@@ -857,9 +852,9 @@
 #define gdFTEX_Big5 2
 #define gdFTEX_Adobe_Custom 3
 
-BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
+BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, const char *fontlist,
                                        double ptsize, double angle, int x, int y,
-                                       char *string, gdFTStringExtraPtr strex);
+                                       const char *string, gdFTStringExtraPtr strex);
 
 
 /*
@@ -977,16 +972,16 @@
    anything up to 256. If the original source image
    includes photographic information or anything that
    came out of a JPEG, 256 is strongly recommended.
-   
+
    Better yet, don't use these function -- write real
    truecolor PNGs and JPEGs. The disk space gain of
    conversion to palette is not great (for small images
    it can be negative) and the quality loss is ugly.
-   
+
    DIFFERENCES: gdImageCreatePaletteFromTrueColor creates and
    returns a new image. gdImageTrueColorToPalette modifies
    an existing image, and the truecolor pixels are discarded.
-   
+
    gdImageTrueColorToPalette() returns TRUE on success, FALSE on failure.
 */
 
@@ -1092,7 +1087,7 @@
 
 /**
  * Group: GifAnim
- * 
+ *
  *   Legal values for Disposal. gdDisposalNone is always used by
  *   the built-in optimizer if previm is passed.
  *
@@ -1318,7 +1313,7 @@
  * Macro: gdImageSX
  *
  * Gets the width (in pixels) of an image.
- * 
+ *
  * Parameters:
  *   im - The image.
  */
@@ -1536,11 +1531,11 @@
  * Group: Crop
  *
  * Constants: gdCropMode
- *  GD_CROP_DEFAULT - Default crop mode (4 corners or background)
+ *  GD_CROP_DEFAULT     - Same as GD_CROP_TRANSPARENT
  *  GD_CROP_TRANSPARENT - Crop using the transparent color
- *  GD_CROP_BLACK - Crop black borders
- *  GD_CROP_WHITE - Crop white borders
- *  GD_CROP_SIDES - Crop using colors of the 4 corners
+ *  GD_CROP_BLACK       - Crop black borders
+ *  GD_CROP_WHITE       - Crop white borders
+ *  GD_CROP_SIDES       - Crop using colors of the 4 corners
  *
  * See also:
  *   - <gdImageCropAuto>
@@ -1634,16 +1629,11 @@
 BGD_DECLARE(const char *) gdExtraVersion(void);
 BGD_DECLARE(const char *) gdVersionString(void);
 
+/* newfangled special effects */
+#include "gdfx.h"
 
 #ifdef __cplusplus
 }
 #endif
 
-/* newfangled special effects */
-#include "gdfx.h"
-
 #endif				/* GD_H */
-
-#ifdef __cplusplus
-}
-#endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd2copypal.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd2copypal.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd2copypal.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd2togif.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd2togif.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd2togif.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -43,4 +43,3 @@
 
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd2topng.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd2topng.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd2topng.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -52,11 +51,7 @@
 		gdImageDestroy (im);
 		exit (1);
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng (im, out);
-#else
-	fprintf(stderr, "No PNG library support available.\n");
-#endif
 	fclose (out);
 	gdImageDestroy (im);
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_bmp.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_bmp.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_bmp.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -19,12 +19,12 @@
  * Read and write BMP images.
  */
 
-/* $Id$ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include <stdio.h>
+#include <limits.h>
 #include <math.h>
 #include <string.h>
 #include <stdlib.h>
@@ -47,6 +47,8 @@
 static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
 static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info);
 
+static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression);
+
 #define BMP_DEBUG(s)
 
 static int gdBMPPutWord(gdIOCtx *out, int w)
@@ -87,8 +89,10 @@
 	void *rv;
 	gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
 	if (out == NULL) return NULL;
-	gdImageBmpCtx(im, out, compression);
-	rv = gdDPExtractData(out, size);
+	if (!_gdImageBmpCtx(im, out, compression))
+		rv = gdDPExtractData(out, size);
+	else
+		rv = NULL;
 	out->gd_free(out);
 	return rv;
 }
@@ -142,6 +146,11 @@
 */
 BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
 {
+	_gdImageBmpCtx(im, out, compression);
+}
+
+static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
+{
 	int bitmap_size = 0, info_size, total_size, padding;
 	int i, row, xpos, pixel;
 	int error = 0;
@@ -148,6 +157,7 @@
 	unsigned char *uncompressed_row = NULL, *uncompressed_row_start = NULL;
 	FILE *tmpfile_for_compression = NULL;
 	gdIOCtxPtr out_original = NULL;
+	int ret = 1;
 
 	/* No compression if its true colour or we don't support seek */
 	if (im->trueColor) {
@@ -325,6 +335,7 @@
 		out_original = NULL;
 	}
 
+	ret = 0;
 cleanup:
 	if (tmpfile_for_compression) {
 #ifdef _WIN32
@@ -338,7 +349,7 @@
 	if (out_original) {
 		out_original->gd_free(out_original);
 	}
-	return;
+	return ret;
 }
 
 static int compress_row(unsigned char *row, int length)
@@ -636,6 +647,9 @@
 		return 1;
 	}
 
+	/* Unlikely, but possible -- largest signed value won't fit in unsigned. */
+	if (info->height == 0 || info->height == INT_MIN)
+		return 1;
 	if (info->height < 0) {
 		info->topdown = 1;
 		info->height = -info->height;
@@ -645,8 +659,9 @@
 
 	info->type = BMP_PALETTE_4;
 
-	if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0 ||
-	        info->depth <= 0  || info->numcolors < 0 || info->mincolors < 0) {
+	/* Height was checked above. */
+	if (info->width <= 0 || info->numplanes <= 0 || info->depth <= 0 ||
+	        info->numcolors < 0 || info->mincolors < 0) {
 		return 1;
 	}
 
@@ -667,11 +682,16 @@
 	/* OS2 v1 doesn't support topdown */
 	info->topdown = 0;
 
+	/* The spec says the depth can only be a few value values. */
+	if (info->depth != 1 && info->depth != 4 && info->depth != 8 &&
+	        info->depth != 16 && info->depth != 24) {
+		return 1;
+	}
+
 	info->numcolors = 1 << info->depth;
 	info->type = BMP_PALETTE_3;
 
-	if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0 ||
-	        info->depth <= 0 || info->numcolors < 0) {
+	if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0) {
 		return 1;
 	}
 
@@ -701,6 +721,9 @@
 		return 1;
 	}
 
+	/* Unlikely, but possible -- largest signed value won't fit in unsigned. */
+	if (info->height == 0 || info->height == INT_MIN)
+		return 1;
 	if (info->height < 0) {
 		info->topdown = 1;
 		info->height = -info->height;
@@ -710,12 +733,12 @@
 
 	info->type = BMP_PALETTE_4;
 
-	if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0 ||
-	        info->depth <= 0  || info->numcolors < 0 || info->mincolors < 0) {
+	/* Height was checked above. */
+	if (info->width <= 0 || info->numplanes <= 0 || info->depth <= 0 ||
+	        info->numcolors < 0 || info->mincolors < 0) {
 		return 1;
 	}
 
-
 	return 0;
 }
 
@@ -758,7 +781,7 @@
 		return 1;
 	}
 
-	/* There is a chance the data isn't until later, would be wierd but it is possible */
+	/* There is a chance the data isn't until later, would be weird but it is possible */
 	if (gdTell(infile) != header->off) {
 		/* Should make sure we don't seek past the file size */
 		if (!gdSeek(infile, header->off)) {
@@ -855,7 +878,7 @@
 
 	im->colorsTotal = info->numcolors;
 
-	/* There is a chance the data isn't until later, would be wierd but it is possible */
+	/* There is a chance the data isn't until later, would be weird but it is possible */
 	if (gdTell(infile) != header->off) {
 		/* Should make sure we don't seek past the file size */
 		if (!gdSeek(infile, header->off)) {
@@ -863,8 +886,8 @@
 		}
 	}
 
-	/* The line must be divisible by 4, else its padded with NULLs */
-	padding = ((int)ceil(0.1 * info->width)) % 4;
+	/* The line must be aligned on a 32 bits word, else it is padded with zeros */
+	padding = (info->width + 7) / 8 % 4;
 	if (padding) {
 		padding = 4 - padding;
 	}
@@ -925,7 +948,7 @@
 
 	im->colorsTotal = info->numcolors;
 
-	/* There is a chance the data isn't until later, would be wierd but it is possible */
+	/* There is a chance the data isn't until later, would be weird but it is possible */
 	if (gdTell(infile) != header->off) {
 		/* Should make sure we don't seek past the file size */
 		if (!gdSeek(infile, header->off)) {
@@ -1012,7 +1035,7 @@
 
 	im->colorsTotal = info->numcolors;
 
-	/* There is a chance the data isn't until later, would be wierd but it is possible */
+	/* There is a chance the data isn't until later, would be weird but it is possible */
 	if (gdTell(infile) != header->off) {
 		/* Should make sure we don't seek past the file size */
 		if (!gdSeek(infile, header->off)) {

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_color_match.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_color_match.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_color_match.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -31,9 +31,8 @@
 		return -4; /* At least 1 color must be allocated */
 	}
 
-	buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * im2->colorsTotal);
-	memset (buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal );
-
+	buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * gdMaxColors);
+	memset (buf, 0, sizeof(unsigned long) * 5 * gdMaxColors );
 	for (x=0; x < im1->sx; x++) {
 		for( y=0; y<im1->sy; y++ ) {
 			color = im2->pixels[y][x];

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_crop.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_crop.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_crop.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,7 +6,7 @@
  * Some functions to crop images, automatically (auto detection of the border
  * color), using a given color (with or without tolerance) or using a given
  * rectangle.
- * 
+ *
  * Example:
  *   (start code)
  *   im2 = gdImageAutoCrop(im, GD_CROP_SIDES);
@@ -48,6 +48,7 @@
 BGD_DECLARE(gdImagePtr) gdImageCrop(gdImagePtr src, const gdRect *crop)
 {
 	gdImagePtr dst;
+	int alphaBlendingFlag;
 
 	if (gdImageTrueColor(src)) {
 		dst = gdImageCreateTrueColor(crop->width, crop->height);
@@ -55,7 +56,10 @@
 		dst = gdImageCreate(crop->width, crop->height);
 	}
 	if (!dst) return NULL;
+	alphaBlendingFlag = dst->alphaBlendingFlag;
+	gdImageAlphaBlending(dst, gdEffectReplace);
 	gdImageCopy(dst, src, 0, 0, crop->x, crop->y, crop->width, crop->height);
+	gdImageAlphaBlending(dst, alphaBlendingFlag);
 
 	return dst;
 }
@@ -126,14 +130,13 @@
 		}
 	}
 
-	/* Nothing to do > bye
-	 * Duplicate the image?
-	 */
-	if (y == height - 1) {
+	/* Whole image would be cropped > bye */
+	if (match) {
 		return NULL;
 	}
 
-	crop.y = y -1;
+	crop.y = y - 1;
+
 	match = 1;
 	for (y = height - 1; match && y >= 0; y--) {
 		for (x = 0; match && x < width; x++) {
@@ -140,16 +143,11 @@
 			match = (color == gdImageGetPixel(im, x,y));
 		}
 	}
+	crop.height = y - crop.y + 2;
 
-	if (y == 0) {
-		crop.height = height - crop.y + 1;
-	} else {
-		crop.height = y - crop.y + 2;
-	}
-
 	match = 1;
 	for (x = 0; match && x < width; x++) {
-		for (y = 0; match && y < crop.y + crop.height - 1; y++) {
+		for (y = 0; match && y < crop.y + crop.height; y++) {
 			match = (color == gdImageGetPixel(im, x,y));
 		}
 	}
@@ -157,7 +155,7 @@
 
 	match = 1;
 	for (x = width - 1; match && x >= 0; x--) {
-		for (y = 0; match &&  y < crop.y + crop.height - 1; y++) {
+		for (y = 0; match &&  y < crop.y + crop.height; y++) {
 			match = (color == gdImageGetPixel(im, x,y));
 		}
 	}
@@ -179,7 +177,7 @@
  *   im        - The image.
  *   color     - The crop color.
  *   threshold - The crop threshold.
- * 
+ *
  * Returns:
  *   The newly created cropped image, or NULL on failure.
  *
@@ -221,15 +219,13 @@
 		}
 	}
 
-	/* Pierre
-	 * Nothing to do > bye
-	 * Duplicate the image?
-	 */
-	if (y == height - 1) {
+	/* Whole image would be cropped > bye */
+	if (match) {
 		return NULL;
 	}
 
-	crop.y = y -1;
+	crop.y = y - 1;
+
 	match = 1;
 	for (y = height - 1; match && y >= 0; y--) {
 		for (x = 0; match && x < width; x++) {
@@ -236,16 +232,11 @@
 			match = (gdColorMatch(im, color, gdImageGetPixel(im, x, y), threshold)) > 0;
 		}
 	}
+	crop.height = y - crop.y + 2;
 
-	if (y == 0) {
-		crop.height = height - crop.y + 1;
-	} else {
-		crop.height = y - crop.y + 2;
-	}
-
 	match = 1;
 	for (x = 0; match && x < width; x++) {
-		for (y = 0; match && y < crop.y + crop.height - 1; y++) {
+		for (y = 0; match && y < crop.y + crop.height; y++) {
 			match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0;
 		}
 	}
@@ -253,7 +244,7 @@
 
 	match = 1;
 	for (x = width - 1; match && x >= 0; x--) {
-		for (y = 0; match &&  y < crop.y + crop.height - 1; y++) {
+		for (y = 0; match &&  y < crop.y + crop.height; y++) {
 			match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0;
 		}
 	}
@@ -290,7 +281,7 @@
 	} else if (tl == tr  || tl == bl || tl == br) {
 		*color = tl;
 		return 2;
-	} else if (tr == bl) {
+	} else if (tr == bl || tr == br) {
 		*color = tr;
 		return 2;
 	} else if (br == bl) {

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_filename.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_filename.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_filename.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -28,7 +28,7 @@
 
 static void BGD_STDCALL writewbmp(gdImagePtr im, FILE *out) {
     int fg = gdImageColorClosest(im, 0, 0, 0);
-    
+
     gdImageWBMP(im, fg, out);
 }/* writejpeg*/
 
@@ -61,7 +61,7 @@
     {".jpeg",   gdImageCreateFromJpeg,  writejpeg,      NULL},
 #endif
 
-#ifdef HAVE_LIBTIFF    
+#ifdef HAVE_LIBTIFF
     {".tiff",   gdImageCreateFromTiff,  gdImageTiff,    NULL},
     {".tif" ,   gdImageCreateFromTiff,  gdImageTiff,    NULL},
 #endif
@@ -90,7 +90,7 @@
     /* Find the file extension (i.e. the last period in the string. */
     ext = strrchr(filename, '.');
     if (!ext) return NULL;
-    
+
     for (n = 0; Types[n].ext; n++) {
         if (strcasecmp(ext, Types[n].ext) == 0) {
             return &Types[n];
@@ -103,7 +103,7 @@
 
 /*
   Function: gdSupportsFileType
-  
+
     Tests if a given file type is supported by GD.
 
     Given the name of an image file (which does not have to exist),
@@ -145,7 +145,7 @@
     GD_TRUE (1) if the file type is supported, GD_FALSE (0) if not.
 
 */
-BGD_DECLARE(int) 
+BGD_DECLARE(int)
 gdSupportsFileType(const char *filename, int writing) {
     struct FileType *entry = ftype(filename);
     return !!entry && (!writing || !!entry->writer);
@@ -159,7 +159,7 @@
 
     Given the path to a file, <gdImageCreateFromFile> will open the
     file, read its contents with the appropriate _gdImageCreateFrom*_
-    function and return it.  
+    function and return it.
 
     File type is determined by the filename extension, so having an
     incorrect extension will probably not work.  For example, renaming
@@ -179,12 +179,12 @@
 
 */
 
-BGD_DECLARE(gdImagePtr) 
+BGD_DECLARE(gdImagePtr)
 gdImageCreateFromFile(const char *filename) {
     struct FileType *entry = ftype(filename);
     FILE *fh;
     gdImagePtr result;
- 
+
     if (!entry) return NULL;
     if (entry->loader) return entry->loader((char *)filename);
     if (!entry->reader) return NULL;
@@ -193,7 +193,7 @@
     if (!fh) return NULL;
 
     result = entry->reader(fh);
-    
+
     fclose(fh);
 
     return result;
@@ -235,7 +235,7 @@
 
 */
 
-BGD_DECLARE(int) 
+BGD_DECLARE(int)
 gdImageFile(gdImagePtr im, const char *filename) {
     struct FileType *entry = ftype(filename);
     FILE *fh;
@@ -251,4 +251,3 @@
 
     return GD_TRUE;
 }/* gdImageFile*/
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_filter.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_filter.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_filter.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -537,6 +537,7 @@
 	for ( y=0; y<src->sy; y++) {
 		for(x=0; x<src->sx; x++) {
 			new_r = new_g = new_b = 0;
+			pxl = f(srcback, x, y);
 			new_a = gdImageAlpha(srcback, pxl);
 
 			for (j=0; j<3; j++) {
@@ -898,7 +899,7 @@
             const int srcpx = (axis == HORIZONTAL) ?
                 src->tpixels[line][rndx] :
                 src->tpixels[rndx][line];
-                
+
             r += coeff * (double)gdTrueColorGetRed(srcpx);
             g += coeff * (double)gdTrueColorGetGreen(srcpx);
             b += coeff * (double)gdTrueColorGetBlue(srcpx);
@@ -912,7 +913,7 @@
 
 
 static void
-applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius, 
+applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius,
             gdAxis axis)
 {
     int line, numlines, linelen;
@@ -939,7 +940,7 @@
     _radius_ is a radius, not a diameter so a radius of 2 (for
     example) will blur across a region 5 pixels across (2 to the
     center, 1 for the center itself and another 2 to the other edge).
-    
+
     _sigma_ represents the "fatness" of the curve (lower == fatter).
     If _sigma_ is less than or equal to 0,
     <gdImageCopyGaussianBlurred> ignores it and instead computes an
@@ -987,10 +988,10 @@
 
     FILE *in;
     gdImagePtr result, src;
-     
+
     in = fopen("foo.png", "rb");
     src = gdImageCreateFromPng(in);
-    
+
     result = gdImageCopyGaussianBlurred(im, src->sx / 10, -1.0);
 
     (end code)
@@ -1034,7 +1035,7 @@
 			gdFree(coeffs);
             return NULL;
         }/* if */
-		
+
         freeSrc = 1;
 	}/* if */
 
@@ -1059,4 +1060,3 @@
 
     return result;
 }/* gdImageCopyGaussianBlurred*/
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_gd.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_gd.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_gd.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -12,21 +12,34 @@
  *  - color header (either truecolor or palette)
  *  - image data
  *
- * All numbers are stored in big-endian format.
+ * All numbers are stored in big-endian format. Note that all GD output is done
+ * in the GD 2.x format (not to be confused with the GD2 format), but input may
+ * also be in the GD 1.x format.
  *
- * File header structure:
+ * GD 1.x file header structure:
+ *  width  - 1 word
+ *  height - 1 word
+ *
+ * GD 1.x color header (palette only):
+ *  count       - 1 byte (the number of used palette colors)
+ *  transparent - 1 word (257 signals no transparency)
+ *  palette     - 256×3 bytes (RGB triplets)
+ *
+ * GD 2.x file header structure:
  *  signature     - 1 word ("\xFF\xFE" for truecolor, "\xFF\xFF" for palette)
  *  width         - 1 word
  *  height        - 1 word
  *
- * Truecolor image color header:
+ * GD 2.x truecolor image color header:
  *  truecolor   - 1 byte (always "\001")
- *  transparent - 1 dword (ARGB color)
+ *  transparent - 1 dword (ARGB color); "\377\377\377\377" means that no
+ *				  transparent color is set
  *
- * Palette image color header:
+ * GD 2.x palette image color header:
  *  truecolor   - 1 byte (always "\0")
  *  count       - 1 word (the number of used palette colors)
- *  transparent - 1 dword (ARGB color)
+ *  transparent - 1 dword (palette index); "\377\377\377\377" means that no
+ *				  transparent color is set
  *  palette     - 256 dwords (RGBA colors)
  *
  * Image data:
@@ -44,7 +57,11 @@
 #include <string.h>
 #include <stdlib.h>
 #include "gd.h"
+#include "gd_errors.h"
 
+/* 2.3: gd is no longer mandatory */
+#if ENABLE_GD_FORMATS
+
 #define TRUE 1
 #define FALSE 0
 
@@ -91,10 +108,11 @@
 		if (!gdGetWord (&im->transparent, in)) {
 			goto fail1;
 		}
-		if (im->transparent == 257) {
-			im->transparent = (-1);
-		}
 	}
+	/* Make sure transparent index is within bounds of the palette. */
+	if (!(im->trueColor) && (im->transparent >= im->colorsTotal || im->transparent < 0)) {
+		im->transparent = (-1);
+	}
 	GD2_DBG (printf
 	         ("Palette had %d colours (T=%d)\n", im->colorsTotal,
 	          im->transparent));
@@ -216,7 +234,7 @@
     > in = fopen("mygd.gd", "rb");
     > im = gdImageCreateFromGd(in);
     > fclose(in);
-    > // ... Use the image ... 
+    > // ... Use the image ...
     > gdImageDestroy(im);
 */
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd (FILE * inFile)
@@ -387,3 +405,41 @@
 	out->gd_free (out);
 	return rv;
 }
+
+#else /* no HAVE_LIBZ or !ENABLE_GD_FORMATS */
+
+static void _noGdError (void)
+{
+	gd_error("GD image support has been disabled\n");
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromGd (FILE * inFile)
+{
+	_noGdError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromGdPtr (int size, void *data)
+{
+	_noGdError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromGdCtx (gdIOCtxPtr in)
+{
+	_noGdError();
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImageGd (gdImagePtr im, FILE * outFile)
+{
+	_noGdError();
+}
+
+BGD_DECLARE(void *) gdImageGdPtr (gdImagePtr im, int *size)
+{
+	_noGdError();
+	return NULL;
+}
+
+#endif /* ENABLE_GD_FORMATS */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_gd2.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_gd2.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_gd2.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -47,16 +47,18 @@
  *  offset - 1 dword
  *  size   - 1 dword
  *
- * There are x_chunk_count * y_chunk_count chunk headers. 
+ * There are x_chunk_count * y_chunk_count chunk headers.
  *
  * Truecolor image color header:
  *  truecolor   - 1 byte (always "\001")
- *  transparent - 1 dword (ARGB color)
+ *  transparent - 1 dword (ARGB color); "\377\377\377\377" means that no
+ *				  transparent color is set
  *
  * Palette image color header:
  *  truecolor   - 1 byte (always "\0")
  *  count       - 1 word (the number of used palette colors)
- *  transparent - 1 dword (ARGB color)
+ *  transparent - 1 dword (palette index); "\377\377\377\377" means that no
+ *				  transparent color is set
  *  palette     - 256 dwords (RGBA colors)
  *
  * Chunk structure:
@@ -83,7 +85,7 @@
 /* 2.03: gd2 is no longer mandatory */
 /* JCE - test after including gd.h so that HAVE_LIBZ can be set in
  * a config.h file included by gd.h */
-#ifdef HAVE_LIBZ
+#if defined(HAVE_LIBZ) && ENABLE_GD_FORMATS
 #include <zlib.h>
 
 #define TRUE 1
@@ -210,7 +212,7 @@
 	GD2_DBG (printf ("%d Chunks vertically\n", *ncy));
 
 	if (gd2_compressed (*fmt)) {
-		if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
+		if (overflow2(*ncx, *ncy)) {
 			GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
 			goto fail1;
 		}
@@ -236,7 +238,7 @@
 			if (gdGetInt (&cidx[i].size, in) != 1) {
 				goto fail2;
 			};
-			if (cidx[i].offset < 0 || cidx[i].size < 0)
+			if (cidx[i].offset < 0 || cidx[i].size < 0 || cidx[i].size == INT_MAX)
 				goto fail2;
 		};
 		*chunkIdx = cidx;
@@ -405,7 +407,7 @@
   Function: gdImageCreateFromGd2Ctx
 
   Reads in a GD2 image via a <gdIOCtx> struct.  See
-  <gdImageCreateFromGd2>.  
+  <gdImageCreateFromGd2>.
 */
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
 {
@@ -436,8 +438,13 @@
 	}
 
 	bytesPerPixel = im->trueColor ? 4 : 1;
+	if (overflow2(ncx, ncy))
+		goto fail;
 	nc = ncx * ncy;
 
+	if (overflow2(ncy, cs) || overflow2(ncx, cs) || overflow2(bytesPerPixel, cs))
+		goto fail;
+
 	if (gd2_compressed (fmt)) {
 		/* Find the maximum compressed chunk size. */
 		compMax = 0;
@@ -1127,39 +1134,43 @@
 	return rv;
 }
 
-#else /* no HAVE_LIBZ */
-static void _noLibzError (void)
+#else /* no HAVE_LIBZ or !ENABLE_GD_FORMATS */
+static void _noGd2Error (void)
 {
+#if !ENABLE_GD_FORMATS
+	gd_error("GD2 image support has been disabled\n");
+#else
 	gd_error("GD2 support is not available - no libz\n");
+#endif
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2 (FILE * inFile)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ptr (int size, void *data)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
@@ -1166,18 +1177,18 @@
 BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w,
         int h)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 
 BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt)
 {
-	_noLibzError();
+	_noGd2Error();
 }
 
 BGD_DECLARE(void *) gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size)
 {
-	_noLibzError();
+	_noGd2Error();
 	return NULL;
 }
 #endif /* HAVE_LIBZ */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_gif_in.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_gif_in.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_gif_in.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -53,7 +53,7 @@
 
 #define BitSet(byte, bit)	(((byte) & (bit)) == (bit))
 
-#define ReadOK(file, buffer, len) (gdGetBuf(buffer, len, file) > 0)
+#define ReadOK(file, buffer, len) (gdGetBuf(buffer, len, file) == len)
 
 #define LM_to_uint(a, b)	(((b)<<8)|(a))
 
@@ -149,7 +149,7 @@
     > in = fopen("mygif.gif", "rb");
     > im = gdImageCreateFromGif(in);
     > fclose(in);
-    > // ... Use the image ... 
+    > // ... Use the image ...
     > gdImageDestroy(im);
 
 */
@@ -335,11 +335,6 @@
 		return 0;
 	}
 
-	if(!im->colorsTotal) {
-		gdImageDestroy(im);
-		return 0;
-	}
-
 	/* Check for open colors at the end, so
 	 * we can reduce colorsTotal and ultimately
 	 * BitsPerPixel */
@@ -351,6 +346,11 @@
 		}
 	}
 
+	if(!im->colorsTotal) {
+		gdImageDestroy(im);
+		return 0;
+	}
+
 	return im;
 }
 
@@ -447,7 +447,7 @@
 GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
 {
 	int i, j, ret;
-	unsigned char count;
+	int count;
 
 	if(flag) {
 		scd->curbit = 0;
@@ -601,6 +601,10 @@
 				/* Bad compressed data stream */
 				return -1;
 			}
+			if(code >= (1 << MAX_LWZ_BITS)) {
+				/* Corrupted code */
+				return -1;
+			}
 
 			*sd->sp++ = sd->table[1][code];
 
@@ -610,6 +614,10 @@
 
 			code = sd->table[0][code];
 		}
+		if(code >= (1 << MAX_LWZ_BITS)) {
+			/* Corrupted code */
+			return -1;
+		}
 
 		*sd->sp++ = sd->firstcode = sd->table[1][code];
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_gif_out.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_gif_out.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_gif_out.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -99,6 +99,11 @@
 static void char_out(int c, GifCtx *ctx);
 static void flush_char(GifCtx *ctx);
 
+static int _gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out);
+static int _gdImageGifAnimAddCtx(gdImagePtr im, gdIOCtxPtr out,
+                                       int LocalCM, int LeftOfs, int TopOfs,
+                                       int Delay, int Disposal,
+                                       gdImagePtr previm);
 
 
 
@@ -131,8 +136,11 @@
 	void *rv;
 	gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
 	if (out == NULL) return NULL;
-	gdImageGifCtx(im, out);
-	rv = gdDPExtractData(out, size);
+	if (!_gdImageGifCtx(im, out)) {
+		rv = gdDPExtractData(out, size);
+	} else {
+		rv = NULL;
+	}
 	out->gd_free(out);
 	return rv;
 }
@@ -221,6 +229,12 @@
 */
 BGD_DECLARE(void) gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
 {
+	_gdImageGifCtx(im, out);
+}
+
+/* returns 0 on success, 1 on failure */
+static int _gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
+{
 	gdImagePtr pim = 0, tim = im;
 	int interlace, BitsPerPixel;
 	interlace = im->interlace;
@@ -231,7 +245,7 @@
 		based temporary image. */
 		pim = gdImageCreatePaletteFromTrueColor(im, 1, 256);
 		if(!pim) {
-			return;
+			return 1;
 		}
 		tim = pim;
 	}
@@ -247,6 +261,8 @@
 		/* Destroy palette based temporary image. */
 		gdImageDestroy(	pim);
 	}
+
+	return 0;
 }
 
 
@@ -475,8 +491,11 @@
 	void *rv;
 	gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
 	if (out == NULL) return NULL;
-	gdImageGifAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm);
-	rv = gdDPExtractData(out, size);
+	if (!_gdImageGifAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm)) {
+		rv = gdDPExtractData(out, size);
+	} else {
+		rv = NULL;
+	}
 	out->gd_free(out);
 	return rv;
 }
@@ -546,18 +565,18 @@
     gdImagePtr im, im2, im3;
     int black, white, trans;
     FILE *out;
-    
+
     im = gdImageCreate(100, 100);     // Create the image
     white = gdImageColorAllocate(im, 255, 255, 255); // Allocate background
     black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color
     trans = gdImageColorAllocate(im, 1, 1, 1); // trans clr for compression
     gdImageRectangle(im, 0, 0, 10, 10, black); // Draw rectangle
-    
+
     out = fopen("anim.gif", "wb");// Open output file in binary mode
     gdImageGifAnimBegin(im, out, 1, 3);// Write GIF hdr, global clr map,loops
     // Write the first frame.  No local color map.  Delay = 1s
     gdImageGifAnimAdd(im, out, 0, 0, 0, 100, 1, NULL);
-    
+
     // construct the second frame
     im2 = gdImageCreate(100, 100);
     (void)gdImageColorAllocate(im2, 255, 255, 255); // White background
@@ -566,7 +585,7 @@
     // Allow animation compression with transparent pixels
     gdImageColorTransparent (im2, trans);
     gdImageGifAnimAdd(im2, out, 0, 0, 0, 100, 1, im);  // Add second frame
-    
+
     // construct the third frame
     im3 = gdImageCreate(100, 100);
     (void)gdImageColorAllocate(im3, 255, 255, 255); // white background
@@ -578,7 +597,7 @@
     gdImageGifAnimAdd(im3, out, 0, 0, 0, 100, 1, im2);
     gdImageGifAnimEnd(out);  // End marker, same as putc(';', out);
     fclose(out); // Close file
-    
+
     // Destroy images
     gdImageDestroy(im);
     gdImageDestroy(im2);
@@ -637,6 +656,15 @@
                                        int Delay, int Disposal,
                                        gdImagePtr previm)
 {
+	_gdImageGifAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm);
+}
+
+/* returns 0 on success, 1 on failure */
+static int _gdImageGifAnimAddCtx(gdImagePtr im, gdIOCtxPtr out,
+                                       int LocalCM, int LeftOfs, int TopOfs,
+                                       int Delay, int Disposal,
+                                       gdImagePtr previm)
+{
 	gdImagePtr pim = NULL, tim = im;
 	int interlace, transparent, BitsPerPixel;
 	interlace = im->interlace;
@@ -653,7 +681,7 @@
 			based temporary image. */
 		pim = gdImageCreatePaletteFromTrueColor(im, 1, 256);
 		if (!pim) {
-			return;
+			return 1;
 		}
 		tim = pim;
 	}
@@ -826,6 +854,7 @@
 	    out, tim->sx, tim->sy, LeftOfs, TopOfs, interlace, transparent,
 	    Delay, Disposal, BitsPerPixel,
 	    LocalCM ? tim->red : 0, tim->green, tim->blue, tim);
+	return 0;
 
 fail_end:
 	if(pim) {
@@ -832,6 +861,7 @@
 		/* Destroy palette based temporary image. */
 		gdImageDestroy(pim);
 	}
+	return 1;
 }
 
 
@@ -1374,7 +1404,7 @@
 	output((code_int)ctx->ClearCode, ctx);
 
 #ifdef SIGNED_COMPARE_SLOW
-	while((c = GIFNextPixel(im)) != (unsigned) EOF) {
+	while((c = GIFNextPixel(im, ctx)) != (unsigned) EOF) {
 #else /* SIGNED_COMPARE_SLOW */
 	while((c = GIFNextPixel(im, ctx)) != EOF) {
 #endif /* SIGNED_COMPARE_SLOW */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_intern.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_intern.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_intern.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,11 +1,8 @@
 #ifndef GD_INTERN_H
 #define GD_INTERN_H
 
-#ifdef HAVE_LIMITS_H
 #include <limits.h>
-#endif
 
-
 #ifndef MAXPATHLEN
 # ifdef PATH_MAX
 #  define MAXPATHLEN PATH_MAX
@@ -87,4 +84,3 @@
 
 
 #endif
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_interpolation.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_interpolation.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_interpolation.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -41,8 +41,8 @@
 	downscaling using the fixed point implementations are usually much faster
 	than the existing gdImageCopyResampled while having a similar or better
 	quality.
-	
-	For image rotations, the optimized versions have a lazy antialiasing for 
+
+	For image rotations, the optimized versions have a lazy antialiasing for
 	the edges of the images. For a much better antialiased result, the affine
 	function is recommended.
 */
@@ -78,7 +78,7 @@
 # include <emmintrin.h>
 #endif
 
-static gdImagePtr gdImageScaleBilinear(gdImagePtr im, 
+static gdImagePtr gdImageScaleBilinear(gdImagePtr im,
                                        const unsigned int new_width,
                                        const unsigned int new_height);
 static gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src,
@@ -278,7 +278,7 @@
 static double KernelBessel_Order1(double x)
 {
 	double p, q;
-	
+
 	if (x == 0.0)
 		return (0.0f);
 	p = x;
@@ -617,7 +617,7 @@
 
 #if defined(_MSC_VER) && !defined(inline)
 # define inline __inline
-#endif 
+#endif
 
 /* keep it for future usage for affine copy over an existing image, targetting fix for 2.2.2 */
 #ifdef FUNCTION_NOT_USED_YET
@@ -654,7 +654,7 @@
 	}
 }
 
-static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed coverage, const int bgColor) 
+static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed coverage, const int bgColor)
 {
 	const gdFixed f_127 = gd_itofx(127);
 	register int c = src->tpixels[y][x];
@@ -948,8 +948,8 @@
 		double r = 0, g = 0, b = 0, a = 0;
 		const int left = contrib->ContribRow[ndx].Left;
 		const int right = contrib->ContribRow[ndx].Right;
-		int *dest = (axis == HORIZONTAL) ? 
-			&dst->tpixels[row][ndx] : 
+		int *dest = (axis == HORIZONTAL) ?
+			&dst->tpixels[row][ndx] :
 			&dst->tpixels[ndx][row];
 
 		int i;
@@ -958,7 +958,7 @@
 		for (i = left; i <= right; i++) {
 			const int left_channel = i - left;
 			const int srcpx = (axis == HORIZONTAL) ?
-				pSrc->tpixels[row][i] : 
+				pSrc->tpixels[row][i] :
 				pSrc->tpixels[i][row];
 
 			r += contrib->ContribRow[ndx].Weights[left_channel]
@@ -1313,8 +1313,8 @@
 			gdFixed f_j = gd_itofx(j);
 			gdFixed f_a = gd_mulfx(f_i, f_dy);
 			gdFixed f_b = gd_mulfx(f_j, f_dx);
-			const gdFixed m = gd_fxtoi(f_a);
-			const gdFixed n = gd_fxtoi(f_b);
+			const long m = gd_fxtoi(f_a);
+			const long n = gd_fxtoi(f_b);
 			gdFixed f_f = f_a - gd_itofx(m);
 			gdFixed f_g = f_b - gd_itofx(n);
 
@@ -1686,7 +1686,7 @@
     return GD_TRUE;
 }
 
-static gdImagePtr 
+static gdImagePtr
 gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees,
                               const int bgColor)
 {
@@ -1799,7 +1799,7 @@
 	return dst;
 }
 
-/** 
+/**
  * Function: gdImageRotateInterpolated
  *
  * Rotate an image
@@ -1821,7 +1821,7 @@
  */
 BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
 {
-	/* round to two decimals and keep the 100x multiplication to use it in the common square angles 
+	/* round to two decimals and keep the 100x multiplication to use it in the common square angles
 	   case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for
 	   slow animations, f.e. */
 	const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100);
@@ -1953,7 +1953,7 @@
 	if (!src->trueColor) {
 		gdImagePaletteToTrueColor(src);
 	}
-	
+
 	/* Translate to dst origin (0,0) */
 	gdAffineTranslate(m, -bbox.x, -bbox.y);
 	gdAffineConcat(m, affine, m);
@@ -1975,6 +1975,51 @@
 	}
 }
 
+/** Function: getPixelRgbInterpolated
+ *   get the index of the image's colors
+ *
+ * Parameters:
+ *  im - Image to draw the transformed image
+ *  tcolor - TrueColor
+ *
+ * Return:
+ *  index of colors
+ */
+static int getPixelRgbInterpolated(gdImagePtr im, const int tcolor)
+{
+	unsigned char r, g, b, a;
+	int ct, i;
+
+	b = (unsigned char)tcolor;
+	g = (unsigned char)(tcolor >> 8);
+	r = (unsigned char)(tcolor >> 16);
+	a = (unsigned char)(tcolor >> 24);
+
+	b = CLAMP(b, 0, 255);
+	g = CLAMP(g, 0, 255);
+	r = CLAMP(r, 0, 255);
+	a = CLAMP(a, 0, 127);
+
+	for (i = 0; i < im->colorsTotal; i++) {
+	    if (im->red[i] == r && im->green[i] == g && im->blue[i] == b && im->alpha[i] == a) {
+			return i;
+		}
+	}
+
+	ct = im->colorsTotal;
+	if (ct == gdMaxColors) {
+		return -1;
+	}
+
+	im->colorsTotal++;
+	im->red[ct] = r;
+	im->green[ct] = g;
+	im->blue[ct] = b;
+	im->alpha[ct] = a;
+	im->open[ct] = 0;
+
+	return ct;
+}
 /**
  * Function: gdTransformAffineCopy
  *  Applies an affine transformation to a region and copy the result
@@ -1988,7 +2033,7 @@
  *  src_area - Rectangular region to rotate in the src image
  *
  * Returns:
- *  GD_TRUE if the affine is rectilinear or GD_FALSE
+ *  GD_TRUE on success or GD_FALSE on failure
  */
 BGD_DECLARE(int) gdTransformAffineCopy(gdImagePtr dst,
 		  int dst_x, int dst_y,
@@ -2001,21 +2046,21 @@
 	int backup_clipx1, backup_clipy1, backup_clipx2, backup_clipy2;
 	register int x, y, src_offset_x, src_offset_y;
 	double inv[6];
-	int *dst_p;
 	gdPointF pt, src_pt;
 	gdRect bbox;
 	int end_x, end_y;
-	gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
+	gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
 
 	/* These methods use special implementations */
 	if (src->interpolation_id == GD_BILINEAR_FIXED || src->interpolation_id == GD_BICUBIC_FIXED || src->interpolation_id == GD_NEAREST_NEIGHBOUR) {
-		interpolation_id_bak = src->interpolation_id;
-		
 		gdImageSetInterpolationMethod(src, GD_BICUBIC);
 	}
 
-
 	gdImageClipRectangle(src, src_region);
+	c1x = src_region->x;
+	c1y = src_region->y;
+	c2x = src_region->x + src_region->width -1;
+	c2y = src_region->y + src_region->height -1;
 
 	if (src_region->x > 0 || src_region->y > 0
 		|| src_region->width < gdImageSX(src)
@@ -2039,13 +2084,14 @@
 		return GD_FALSE;
 	}
 
-	gdImageGetClip(dst, &c1x, &c1y, &c2x, &c2y);
-
 	end_x = bbox.width  + abs(bbox.x);
 	end_y = bbox.height + abs(bbox.y);
 
 	/* Get inverse affine to let us work with destination -> source */
-	gdAffineInvert(inv, affine);
+	if (gdAffineInvert(inv, affine) == GD_FALSE) {
+		gdImageSetInterpolationMethod(src, interpolation_id_bak);
+		return GD_FALSE;
+	}
 
 	src_offset_x =  src_region->x;
 	src_offset_y =  src_region->y;
@@ -2053,28 +2099,51 @@
 	if (dst->alphaBlendingFlag) {
 		for (y = bbox.y; y <= end_y; y++) {
 			pt.y = y + 0.5;
-			for (x = 0; x <= end_x; x++) {
+			for (x = bbox.x; x <= end_x; x++) {
 				pt.x = x + 0.5;
 				gdAffineApplyToPointF(&src_pt, &pt, inv);
-				gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, 0));
+				if (floor(src_offset_x + src_pt.x) < c1x
+					|| floor(src_offset_x + src_pt.x) > c2x
+					|| floor(src_offset_y + src_pt.y) < c1y
+					|| floor(src_offset_y + src_pt.y) > c2y) {
+					continue;
+				}
+				gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, (int)(src_offset_x + src_pt.x), (int)(src_offset_y + src_pt.y), 0));
 			}
 		}
 	} else {
-		for (y = 0; y <= end_y; y++) {
-			pt.y = y + 0.5 + bbox.y;
+		for (y = bbox.y; y <= end_y; y++) {
+			unsigned char *dst_p = NULL;
+			int *tdst_p = NULL;
+
+			pt.y = y + 0.5;
 			if ((dst_y + y) < 0 || ((dst_y + y) > gdImageSY(dst) -1)) {
 				continue;
 			}
-			dst_p = dst->tpixels[dst_y + y] + dst_x;
+			if (dst->trueColor) {
+				tdst_p = dst->tpixels[dst_y + y] + dst_x;
+			} else {
+				dst_p = dst->pixels[dst_y + y] + dst_x;
+			}
 
-			for (x = 0; x <= end_x; x++) {
-				pt.x = x + 0.5 + bbox.x;
+			for (x = bbox.x; x <= end_x; x++) {
+				pt.x = x + 0.5;
 				gdAffineApplyToPointF(&src_pt, &pt, inv);
 
 				if ((dst_x + x) < 0 || (dst_x + x) > (gdImageSX(dst) - 1)) {
 					break;
 				}
-				*(dst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1);
+				if (floor(src_offset_x + src_pt.x) < c1x
+					|| floor(src_offset_x + src_pt.x) > c2x
+					|| floor(src_offset_y + src_pt.y) < c1y
+					|| floor(src_offset_y + src_pt.y) > c2y) {
+					continue;
+				}
+				if (dst->trueColor) {
+					*(tdst_p + dst_x + x) = getPixelInterpolated(src, (int)(src_offset_x + src_pt.x), (int)(src_offset_y + src_pt.y), -1);
+				} else {
+					*(dst_p + dst_x + x) = getPixelRgbInterpolated(dst, getPixelInterpolated(src, (int)(src_offset_x + src_pt.x), (int)(src_offset_y + src_pt.y), -1));
+				}
 			}
 		}
 	}
@@ -2137,8 +2206,8 @@
 	}
 	bbox->x = (int) min.x;
 	bbox->y = (int) min.y;
-	bbox->width  = (int) ceil((max.x - min.x)) + 1;
-	bbox->height = (int) ceil(max.y - min.y) + 1;
+	bbox->width  = (int) ceil((max.x - min.x));
+	bbox->height = (int) ceil(max.y - min.y);
 
 	return GD_TRUE;
 }
@@ -2236,9 +2305,9 @@
 		case GD_DEFAULT:
 			id = GD_LINEAR;
 			im->interpolation = filter_linear;
+			break;
 		default:
 			return 0;
-			break;
 	}
 	im->interpolation_id = id;
 	return 1;

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_io.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_io.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_io.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -129,7 +129,7 @@
 
 int gdGetInt(int *result, gdIOCtx *ctx)
 {
-	int r;
+	unsigned int r;
 
 	r = (ctx->getC)(ctx);
 	if(r == EOF) {
@@ -164,7 +164,7 @@
 
 int gdGetIntLSB(signed int *result, gdIOCtx *ctx)
 {
-	int c = 0;
+	unsigned int c;
 	unsigned int r = 0;
 
 	c = (ctx->getC) (ctx);

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_io.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_io.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_io.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,12 +1,12 @@
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef GD_IO_H
 #define GD_IO_H 1
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef VMS
 #	define Putchar gdPutchar
 #endif
@@ -17,7 +17,7 @@
   typedef: gdIOCtx
 
   gdIOCtx structures hold function pointers for doing image IO.
-  
+
   Most of the gd functions that read and write files, such as
   <gdImagePng> also have variants that accept a <gdIOCtx> structure;
   see <gdImagePngCtx> and <gdImageCreateFromJpegCtx>.
@@ -45,14 +45,14 @@
   > {
   >   int (*getC) (struct gdIOCtx *);
   >   int (*getBuf) (struct gdIOCtx *, void *, int wanted);
-  > 
+  >
   >   void (*putC) (struct gdIOCtx *, int);
   >   int (*putBuf) (struct gdIOCtx *, const void *, int wanted);
-  > 
-  >   // seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! 
+  >
+  >   // seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
   >   int (*seek) (struct gdIOCtx *, const int);
   >   long (*tell) (struct gdIOCtx *);
-  > 
+  >
   >   void (*gd_free) (struct gdIOCtx *);
   > } gdIOCtx;
 
@@ -93,8 +93,8 @@
 int gdSeek(gdIOCtx *ctx, const int offset);
 long gdTell(gdIOCtx *ctx);
 
-#endif
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_io_dp.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_io_dp.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_io_dp.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,7 +6,7 @@
  * Based on GD.pm code by Lincoln Stein for interfacing to libgd.
  * Added support for reading as well as support for 'tell' and 'seek'.
  *
- * As will all I/O modules, most functions are for local use only (called
+ * As with all I/O modules, most functions are for local use only (called
  * via function pointers in the I/O context).
  *
  * gdDPExtractData is the exception to this: it will return the pointer to

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 /* *****************************************************************************
-** $Id$
 ** Initial file written and documented by:
 ** Kevin Shepherd <kshepherd at php.net> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -6,7 +5,7 @@
 *******************************************************************************/
 /** \file gd_io_stream.cxx
 	\brief Implementation of the methods of the gdIOCtx std stream specialization.
-	
+
 	Implements the derived specializations of gdIOCtx.
 	These methods are not called by users of libgd, they
 	are internal implementation.
@@ -22,7 +21,7 @@
 #include "gd_io_stream.h"
 
 /**	Read into buffer from stream
-	Return the number of bytes successfully read.  
+	Return the number of bytes successfully read.
 	If an error occurs, or the end-of-file is reached, the return value
 	is a short byte	count (or zero).
 */
@@ -33,7 +32,7 @@
 	return _str->gcount();
 	}
 /**	Write from buffer to stream
-	Return the number of bytes successfully written.  
+	Return the number of bytes successfully written.
 	If an error occurs, or the end-of-file is reached, the return value
 	is a short byte	count (or zero).
 */
@@ -58,7 +57,7 @@
 	}
 
 /** Seek to position offset from the beginning of the stream
-	must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! 
+	must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
 */
 int	istreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos)
 	{
@@ -82,7 +81,7 @@
 	}
 
 /**	Read into buffer from stream
-	Return the number of bytes successfully read.  
+	Return the number of bytes successfully read.
 	If an error occurs, or the end-of-file is reached, the return value
 	is a short byte	count (or zero).
 */
@@ -91,7 +90,7 @@
 	return 0;
 	}
 /**	Write from buffer to stream
-	Return the number of bytes successfully written.  
+	Return the number of bytes successfully written.
 	If an error occurs, or the end-of-file is reached, the return value
 	is a short byte	count (or zero).
 */
@@ -119,7 +118,7 @@
 	}
 
 /** Seek to position offset from the beginning of the stream
-	must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! 
+	must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
 */
 int	ostreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos)
 	{

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_io_stream.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 /* *****************************************************************************
-** $Id$
 ** Initial file written and documented by:
 ** Kevin Shepherd <kshepherd at php.net> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -27,9 +26,9 @@
 		}
 	gdImageDestroy(im_in);
 */
-#ifdef __cplusplus
 #ifndef _gd_io_stream_h
 #define _gd_io_stream_h
+#ifdef __cplusplus
 
 #include "gd.h"
 #include <iostream>
@@ -122,5 +121,5 @@
 	return new ostreamIOCtx(* __stream);
 }
 
+#endif /* __cplusplus */
 #endif /* _gd_io_stream_h */
-#endif /* __cplusplus */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_jpeg.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_jpeg.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_jpeg.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -47,12 +47,6 @@
 # define HAVE_BOOLEAN
 #endif
 
-/* JCE undef two symbols that we don't need anymore but which are
-   may be defined in config.h from ./configure but which are
-   redefined incompatibly in jpeglib.h */
-#undef HAVE_STDDEF_H
-#undef HAVE_STDLIB_H
-
 /* 1.8.1: remove dependency on jinclude.h */
 #include "jpeglib.h"
 #include "jerror.h"
@@ -123,6 +117,8 @@
 	exit(99);
 }
 
+static int _gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality);
+
 /*
  * Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality
  * QUALITY.  If QUALITY is in the range 0-100, increasing values
@@ -237,8 +233,11 @@
 	void *rv;
 	gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
 	if (out == NULL) return NULL;
-	gdImageJpegCtx(im, out, quality);
-	rv = gdDPExtractData(out, size);
+	if (!_gdImageJpegCtx(im, out, quality)) {
+		rv = gdDPExtractData(out, size);
+	} else {
+		rv = NULL;
+	}
 	out->gd_free(out);
 	return rv;
 }
@@ -255,11 +254,17 @@
 
     im      - The image to write.
     outfile - The output sink.
-    quality - Image quality. 
+    quality - Image quality.
 
 */
 BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
 {
+	_gdImageJpegCtx(im, outfile, quality);
+}
+
+/* returns 0 on success, 1 on failure */
+static int _gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
+{
 	struct jpeg_compress_struct cinfo;
 	struct jpeg_error_mgr jerr;
 	int i, j, jidx;
@@ -293,7 +298,7 @@
 		if(row) {
 			gdFree(row);
 		}
-		return;
+		return 1;
 	}
 
 	cinfo.err->emit_message = jpeg_emit_message;
@@ -334,7 +339,7 @@
 	if(row == 0) {
 		gd_error("gd-jpeg: error: unable to allocate JPEG row structure: gdCalloc returns NULL\n");
 		jpeg_destroy_compress(&cinfo);
-		return;
+		return 1;
 	}
 
 	rowptr[0] = row;
@@ -411,6 +416,7 @@
 	jpeg_finish_compress(&cinfo);
 	jpeg_destroy_compress(&cinfo);
 	gdFree(row);
+	return 0;
 }
 
 
@@ -496,7 +502,7 @@
   Function: gdImageCreateFromJpegPtr
 
   Parameters:
-  
+
     size    - size of JPEG data in bytes.
     data    - pointer to JPEG data.
 
@@ -511,7 +517,7 @@
   Function: gdImageCreateFromJpegPtrEx
 
   Parameters:
-  
+
     size            - size of JPEG data in bytes.
     data            - pointer to JPEG data.
     ignore_warning  - if true, ignore recoverable warnings
@@ -1198,4 +1204,63 @@
 	dest->outfile = outfile;
 }
 
+#else /* !HAVE_LIBJPEG */
+
+static void _noJpegError(void)
+{
+	gd_error("JPEG image support has been disabled\n");
+}
+
+BGD_DECLARE(void) gdImageJpeg(gdImagePtr im, FILE *outFile, int quality)
+{
+	_noJpegError();
+}
+
+BGD_DECLARE(void *) gdImageJpegPtr(gdImagePtr im, int *size, int quality)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
+{
+	_noJpegError();
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg(FILE *inFile)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegEx(FILE *inFile, int ignore_warning)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr(int size, void *data)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtrEx(int size, void *data, int ignore_warning)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtx(gdIOCtx *infile)
+{
+	_noJpegError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning)
+{
+	_noJpegError();
+	return NULL;
+}
+
 #endif /* HAVE_LIBJPEG */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_matrix.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_matrix.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_matrix.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -57,13 +57,13 @@
  *  <gdAffineIdentity>
  *
  * Returns:
- *  GD_TRUE if the affine is rectilinear or GD_FALSE
+ *  GD_TRUE on success or GD_FALSE on failure
  */
 BGD_DECLARE(int) gdAffineInvert (double dst[6], const double src[6])
 {
 	double r_det = (src[0] * src[3] - src[1] * src[2]);
 
-	if (r_det <= 0.0) {
+	if (fabs(r_det) <= 0.0) {
 		return GD_FALSE;
 	}
 
@@ -333,4 +333,3 @@
 	  fabs (m1[4] - m2[4]) < GD_EPSILON &&
 	  fabs (m1[5] - m2[5]) < GD_EPSILON);
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -464,7 +464,7 @@
 	radius = initradius;
 
 	rad = radius >> radiusbiasshift;
-	
+
 	for (i=0; i<rad; i++)
 		nnq->radpower[i] = alpha*(((rad*rad - i*i)*radbias)/(rad*rad));
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_nnquant.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 /* maximum number of colours that can be used.
   actual number is now passed to initcolors */
 #define MAXNETSIZE	256
@@ -15,5 +14,3 @@
 #define prime4		503
 
 #define minpicturebytes	(4*prime4)		/* minimum size for input image */
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_png.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_png.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_png.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-/* $Id$ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -592,7 +591,7 @@
     gdImagePtr im;
     int black, white;
     FILE *out;
-     
+
     im = gdImageCreate(100, 100);              // Create the image
     white = gdImageColorAllocate(im, 255, 255, 255); // Alloc background
     black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color
@@ -772,6 +771,7 @@
 	png_color palette[gdMaxColors];
 	png_structp png_ptr;
 	png_infop info_ptr;
+	png_bytep *row_pointers = NULL;
 	volatile int transparent = im->transparent;
 	volatile int remap = FALSE;
 #ifdef PNG_SETJMP_SUPPORTED
@@ -806,6 +806,13 @@
 	if (setjmp(jbw.jmpbuf)) {
 		gd_error("gd-png error: setjmp returns error condition\n");
 		png_destroy_write_struct (&png_ptr, &info_ptr);
+
+		if (row_pointers) {
+			for (i = 0; i < height; ++i)
+				gdFree(row_pointers[i]);
+			gdFree(row_pointers);
+		}
+
 		return 1;
 	}
 #endif
@@ -981,7 +988,6 @@
 		/* performance optimizations by Phong Tran */
 		int channels = im->saveAlphaFlag ? 4 : 3;
 		/* Our little 7-bit alpha channel trick costs us a bit here. */
-		png_bytep *row_pointers;
 		unsigned char *pOutputRow;
 		int **ptpixels = im->tpixels;
 		int *pThisRow;
@@ -993,7 +999,8 @@
 			ret = 1;
 			goto bail;
 		}
-		row_pointers = gdMalloc (sizeof (png_bytep) * height);
+		/* Need to use calloc so we can clean it up sanely in the error handler. */
+		row_pointers = gdCalloc(height, sizeof (png_bytep));
 		if (row_pointers == NULL) {
 			gd_error("gd-png error: unable to allocate row_pointers\n");
 			ret = 1;
@@ -1082,5 +1089,57 @@
 	return ret;
 }
 
+#else /* !HAVE_LIBPNG */
 
+static void _noPngError(void)
+{
+	gd_error("PNG image support has been disabled\n");
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromPng (FILE * inFile)
+{
+	_noPngError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromPngPtr (int size, void *data)
+{
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromPngCtx (gdIOCtx * infile)
+{
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImagePngEx (gdImagePtr im, FILE * outFile, int level)
+{
+	_noPngError();
+}
+
+BGD_DECLARE(void) gdImagePng (gdImagePtr im, FILE * outFile)
+{
+	_noPngError();
+}
+
+BGD_DECLARE(void *) gdImagePngPtr (gdImagePtr im, int *size)
+{
+	return NULL;
+}
+
+BGD_DECLARE(void *) gdImagePngPtrEx (gdImagePtr im, int *size, int level)
+{
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile)
+{
+	_noPngError();
+}
+
+BGD_DECLARE(void) gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level)
+{
+	_noPngError();
+}
+
 #endif /* HAVE_LIBPNG */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_tga.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_tga.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_tga.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -206,7 +206,7 @@
 int read_image_tga( gdIOCtx *ctx, oTga *tga )
 {
 	int pixel_block_size = (tga->bits / 8);
-	int image_block_size = (tga->width * tga->height) * pixel_block_size;
+	int image_block_size;
 	int* decompression_buffer = NULL;
 	unsigned char* conversion_buffer = NULL;
 	int buffer_caret = 0;
@@ -223,6 +223,7 @@
 		return -1;
 	}
 
+	image_block_size = (tga->width * tga->height) * pixel_block_size;
 	if(overflow2(image_block_size, sizeof(int))) {
 		return -1;
 	}

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_tiff.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_tiff.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_tiff.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -27,7 +27,6 @@
 
    ----------------------------------------------------------------------------
  */
-/* $Id$ */
 
 /**
  * File: TIFF IO
@@ -790,7 +789,7 @@
 				rgba = buffer[(y * width + x)];
 				a = (0xff - TIFFGetA(rgba)) / 2;
 				color = gdTrueColorAlpha(TIFFGetR(rgba), TIFFGetG(rgba), TIFFGetB(rgba), a);
-	
+
 				/* set pixel colour to this colour */
 				gdImageSetPixel(im, x, height - y - 1, color);
 			}
@@ -993,10 +992,10 @@
 		goto error;
 	}
 
-	if (TIFFGetField(tif, TIFFTAG_XRESOLUTION, &res_float)) { 
+	if (TIFFGetField(tif, TIFFTAG_XRESOLUTION, &res_float)) {
 		im->res_x = (unsigned int)res_float;  //truncate
 	}
-	if (TIFFGetField(tif, TIFFTAG_YRESOLUTION, &res_float)) { 
+	if (TIFFGetField(tif, TIFFTAG_YRESOLUTION, &res_float)) {
 		im->res_y = (unsigned int)res_float;  //truncate
 	}
 
@@ -1070,4 +1069,45 @@
 	return rv;
 }
 
+#else
+
+static void _noTiffError(void)
+{
+	gd_error("TIFF image support has been disabled\n");
+}
+
+BGD_DECLARE(void) gdImageTiffCtx(gdImagePtr image, gdIOCtx *out)
+{
+	_noTiffError();
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffCtx(gdIOCtx *infile)
+{
+	_noTiffError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromTiff(FILE *inFile)
+{
+	_noTiffError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffPtr(int size, void *data)
+{
+	_noTiffError();
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImageTiff(gdImagePtr im, FILE *outFile)
+{
+	_noTiffError();
+}
+
+BGD_DECLARE(void *) gdImageTiffPtr(gdImagePtr im, int *size)
+{
+	_noTiffError();
+	return NULL;
+}
+
 #endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_topal.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_topal.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_topal.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1383,7 +1383,7 @@
  *   method - The quantization method, see <gdPaletteQuantizationMethod>.
  *   speed  - The quantization speed between 1 (highest quality) and
  *            10 (fastest). 0 selects a method-specific default (recommended).
- *   
+ *
  * Returns:
  *   Zero if the given method is invalid or not available; non-zero otherwise.
  *
@@ -1451,7 +1451,7 @@
  *
  * Returns:
  *   A newly create palette image; NULL on failure.
- *   
+ *
  * See also:
  *   - <gdImageCreatePaletteFromTrueColor>
  *   - <gdImageTrueColorToPaletteSetMethod>
@@ -1523,6 +1523,15 @@
 	oim->tpixels = 0;
 }
 
+#ifdef HAVE_LIBIMAGEQUANT
+/* liq requires 16 byte aligned heap memory */
+static void *malloc16(size_t size)
+{
+	void *p;
+	return posix_memalign(&p, 16, size) == 0 ? p : NULL;
+}
+#endif
+
 /*
  * Module initialization routine for 2-pass color quantization.
  */
@@ -1586,7 +1595,7 @@
 		nim = gdImageNeuQuant(oim, colorsWanted, oim->paletteQuantizationSpeed ? oim->paletteQuantizationSpeed : 2);
 		if (cimP) {
 			*cimP = nim;
-		} 
+		}
 		if (!nim) {
 			return FALSE;
 		} else {
@@ -1601,7 +1610,7 @@
 #ifdef HAVE_LIBIMAGEQUANT
 	if (oim->paletteQuantizationMethod == GD_QUANT_DEFAULT ||
 	        oim->paletteQuantizationMethod == GD_QUANT_LIQ) {
-		liq_attr *attr = liq_attr_create_with_allocator(gdMalloc, gdFree);
+		liq_attr *attr = liq_attr_create_with_allocator(malloc16, free);
 		liq_image *image;
 		liq_result *remap;
 		int remapped_ok = 0;

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_transform.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_transform.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_transform.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -120,5 +120,3 @@
 	gdImageFlipVertical(im);
 	gdImageFlipHorizontal(im);
 }
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_wbmp.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_wbmp.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_wbmp.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -88,6 +88,8 @@
 	return (gdGetC((gdIOCtx *)in));
 }
 
+static int _gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out);
+
 /*
 	Function: gdImageWBMPCtx
 
@@ -101,6 +103,12 @@
 */
 BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
 {
+	_gdImageWBMPCtx(image, fg, out);
+}
+
+/* returns 0 on success, 1 on failure */
+static int _gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
+{
 	int x, y, pos;
 	Wbmp *wbmp;
 
@@ -107,7 +115,7 @@
 	/* create the WBMP */
 	if((wbmp = createwbmp(gdImageSX(image), gdImageSY(image), WBMP_WHITE)) == NULL) {
 		gd_error("Could not create WBMP\n");
-		return;
+		return 1;
 	}
 
 	/* fill up the WBMP structure */
@@ -123,11 +131,15 @@
 
 	/* write the WBMP to a gd file descriptor */
 	if(writewbmp(wbmp, &gd_putout, out)) {
+		freewbmp(wbmp);
 		gd_error("Could not save WBMP\n");
+		return 1;
 	}
 
 	/* des submitted this bugfix: gdFree the memory. */
 	freewbmp(wbmp);
+
+	return 0;
 }
 
 /*
@@ -134,7 +146,7 @@
   Function: gdImageCreateFromWBMPCtx
 
   Reads in a WBMP image via a <gdIOCtx> struct.  See
-  <gdImageCreateFromWBMP>.  
+  <gdImageCreateFromWBMP>.
 */
 BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx(gdIOCtx *infile)
 {
@@ -271,8 +283,11 @@
 	void *rv;
 	gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
 	if (out == NULL) return NULL;
-	gdImageWBMPCtx(im, fg, out);
-	rv = gdDPExtractData(out, size);
+	if (!_gdImageWBMPCtx(im, fg, out)) {
+		rv = gdDPExtractData(out, size);
+	} else {
+		rv = NULL;
+	}
 	out->gd_free(out);
 	return rv;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_webp.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_webp.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_webp.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -9,7 +9,6 @@
 #endif /* HAVE_CONFIG_H */
 
 
-#ifdef HAVE_LIBWEBP
 #include <stdio.h>
 #include <math.h>
 #include <string.h>
@@ -17,6 +16,8 @@
 #include "gd.h"
 #include "gd_errors.h"
 #include "gdhelpers.h"
+
+#ifdef HAVE_LIBWEBP
 #include "webp/decode.h"
 #include "webp/encode.h"
 
@@ -212,7 +213,7 @@
 			}
 			*(p++) = gdTrueColorGetRed(c);
 			*(p++) = gdTrueColorGetGreen(c);
-			*(p++) = gdTrueColorGetBlue(c); 
+			*(p++) = gdTrueColorGetBlue(c);
 			*(p++) = a;
 		}
 	}
@@ -360,4 +361,57 @@
 	out->gd_free(out);
 	return rv;
 }
+
+#else /* !HAVE_LIBWEBP */
+
+static void _noWebpError(void)
+{
+	gd_error("WEBP image support has been disabled\n");
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWebp (FILE * inFile)
+{
+	_noWebpError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpPtr (int size, void *data)
+{
+	_noWebpError();
+	return NULL;
+}
+
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpCtx (gdIOCtx * infile)
+{
+	_noWebpError();
+	return NULL;
+}
+
+BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
+{
+	_noWebpError();
+}
+
+BGD_DECLARE(void) gdImageWebpEx (gdImagePtr im, FILE * outFile, int quality)
+{
+	_noWebpError();
+}
+
+BGD_DECLARE(void) gdImageWebp (gdImagePtr im, FILE * outFile)
+{
+	_noWebpError();
+}
+
+BGD_DECLARE(void *) gdImageWebpPtr (gdImagePtr im, int *size)
+{
+	_noWebpError();
+	return NULL;
+}
+
+BGD_DECLARE(void *) gdImageWebpPtrEx (gdImagePtr im, int *size, int quality)
+{
+	_noWebpError();
+	return NULL;
+}
+
 #endif /* HAVE_LIBWEBP */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gd_xbm.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gd_xbm.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gd_xbm.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -169,7 +169,11 @@
 			}
 			h[3] = ch;
 		}
-		sscanf(h, "%x", &b);
+		if (sscanf(h, "%x", &b) != 1) {
+			gd_error("invalid XBM");
+			gdImageDestroy(im);
+			return 0;
+		}
 		for (bit = 1; bit <= max_bit; bit = bit << 1) {
 			gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0);
 			if (x == im->sx) {
@@ -220,7 +224,7 @@
  *  gd        - Which color to use as forground color. All pixels with another
  *              color are unset.
  *  out       - The <gdIOCtx> to write the image file to.
- * 
+ *
  */
 BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out)
 {

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdcache.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdcache.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdcache.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -25,7 +25,9 @@
  * John Ellson  (ellson at graphviz.org)  Oct 31, 1997
  *
  * Test this with:
- *               gcc -o gdcache -g -Wall -DTEST gdcache.c
+ *               gcc -o gdcache -g -Wall -DTEST -DNEED_CACHE gdcache.c -lgd
+ *               or
+ *               gcc -o gdcache -g -Wall -DTEST -DNEED_CACHE gdcache.c libgd.a
  *
  * The cache is implemented by a singly-linked list of elements
  * each containing a pointer to a user struct that is being managed by
@@ -137,8 +139,13 @@
 		}
 	} else {
 		/* cache full - replace least-recently-used */
-		/* preveprev becomes new end of list */
-		prevprev->next = NULL;
+		if(!prevprev) {
+			/* cache size is 1 */
+			head->mru = NULL;
+		} else {
+			/* prevprev becomes new end of list */
+			prevprev->next = NULL;
+		}
 		elem = prev;
 		(*(head->gdCacheRelease))(elem->userdata);
 	}
@@ -192,7 +199,7 @@
 	gdFree((char *)map);
 }
 
-int main(char *argv[], int argc)
+int main(int argc, char **argv)
 {
 	gdCache_head_t *cacheTable;
 	int elem, key;

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdcache.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdcache.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdcache.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -12,7 +12,9 @@
 	 * John Ellson  (ellson at graphviz.org)  Oct 31, 1997
 	 *
 	 * Test this with:
-	 *		 gcc -o gdcache -g -Wall -DTEST gdcache.c
+	 *		 gcc -o gdcache -g -Wall -DTEST -DNEED_CACHE gdcache.c -lgd
+   *		 or
+	 *		 gcc -o gdcache -g -Wall -DTEST -DNEED_CACHE gdcache.c libgd.a
 	 *
 	 * The cache is implemented by a singly-linked list of elements
 	 * each containing a pointer to a user struct that is being managed by

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdcmpgif.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdcmpgif.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdcmpgif.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -89,5 +89,3 @@
 		printf("-%s: INFO actual colours of pixels differ\n",msg);
 	}
 }
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gddemo.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gddemo.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gddemo.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -16,7 +15,6 @@
 int
 main (void)
 {
-#ifdef HAVE_LIBPNG
 	/* Input and output files */
 	FILE *in;
 	FILE *out;
@@ -181,8 +179,5 @@
 	if (im_in) {
 		gdImageDestroy (im_in);
 	}
-#else
-	fprintf(stderr, "No PNG library support.\n");
-#endif /* HAVE_LIBPNG */
 	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfontg.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfontg.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfontg.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-
-
 /*
    This is a header file for gd font, generated using
    bdftogd version 0.51 by Jan Pazdziora, adelton at fi.muni.cz

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfontl.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfontl.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfontl.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-
-
 /*
    This is a header file for gd font, generated using
    bdftogd version 0.5 by Jan Pazdziora, adelton at fi.muni.cz

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfontmb.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfontmb.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfontmb.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-
-
 /*
    This is a header file for gd font, generated using
    bdftogd version 0.5 by Jan Pazdziora, adelton at fi.muni.cz

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfontt.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfontt.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfontt.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,3 @@
-
-
 /*
    This is a header file for gd font, generated using
    bdftogd version 0.5 by Jan Pazdziora, adelton at fi.muni.cz

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdft.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdft.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdft.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 /********************************************/
 /* gd interface to freetype library         */
 /*                                          */
@@ -72,9 +71,7 @@
  */
 
 #ifndef DEFAULT_FONTPATH
-#  ifdef NETWARE
-#    define DEFAULT_FONTPATH "sys:/java/nwgfx/lib/x11/fonts/ttf;."
-#  elif defined(_WIN32)
+#  if defined(_WIN32)
 #    define DEFAULT_FONTPATH "C:\\WINDOWS\\FONTS;C:\\WINNT\\FONTS"
 #  elif defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh))
 #    define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts"
@@ -85,7 +82,7 @@
 #endif
 
 #ifndef PATHSEPARATOR
-#  if defined(NETWARE) || defined(_WIN32)
+#  if defined(_WIN32)
 #    define PATHSEPARATOR ";"
 #  else
 #    define PATHSEPARATOR ":"
@@ -103,8 +100,8 @@
  *
  * Alias of <gdImageStringFT>.
  */
-BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist,
-                                      double ptsize, double angle, int x, int y, char *string)
+BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, const char *fontlist,
+                                      double ptsize, double angle, int x, int y, const char *string)
 {
 	/* 2.0.6: valid return */
 	return gdImageStringFT (im, brect, fg, fontlist, ptsize,
@@ -112,8 +109,8 @@
 }
 
 #ifndef HAVE_LIBFREETYPE
-BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
-                                       double ptsize, double angle, int x, int y, char *string,
+BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, const char *fontlist,
+                                       double ptsize, double angle, int x, int y, const char *string,
                                        gdFTStringExtraPtr strex)
 {
 	(void)im;
@@ -130,8 +127,8 @@
 	return "libgd was not built with FreeType font support\n";
 }
 
-BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
-                                     double ptsize, double angle, int x, int y, char *string)
+BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, const char *fontlist,
+                                     double ptsize, double angle, int x, int y, const char *string)
 {
 	(void)im;
 	(void)brect;
@@ -184,7 +181,7 @@
 font_t;
 
 typedef struct {
-	char *fontlist;		/* key */
+	const char *fontlist;		/* key */
 	int flags;			/* key */
 	FT_Library *library;
 }
@@ -260,7 +257,7 @@
 	return strcmp(en1->name, en2->name);
 }
 
-extern int any2eucjp (char *, char *, unsigned int);
+extern int any2eucjp (char *, const char *, unsigned int);
 
 /* Persistent font cache until explicitly cleared */
 /* Fonts can be used across multiple images */
@@ -273,7 +270,7 @@
 #define Tcl_UniChar int
 #define TCL_UTF_MAX 3
 static int
-gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr)
+gdTcl_UtfToUniChar (const char *str, Tcl_UniChar * chPtr)
 /* str is the UTF8 next character pointer */
 /* chPtr is the int for the result */
 {
@@ -432,6 +429,107 @@
 	return 1;
 }
 
+#ifdef HAVE_LIBRAQM
+#include <raqm.h>
+#endif
+
+typedef struct {
+	unsigned int index;
+	FT_Pos x_advance;
+	FT_Pos x_offset;
+	FT_Pos y_offset;
+	uint32_t cluster;
+} glyphInfo;
+
+static size_t
+textLayout(uint32_t *text, int len,
+		FT_Face face, gdFTStringExtraPtr strex,
+		glyphInfo **glyph_info)
+{
+	size_t count;
+	glyphInfo *info;
+
+#ifdef HAVE_LIBRAQM
+	size_t i;
+	raqm_glyph_t *glyphs;
+	raqm_t *rq = raqm_create ();
+
+	if (!rq || !raqm_set_text (rq, text, len) ||
+		!raqm_set_freetype_face (rq, face) ||
+		!raqm_set_par_direction (rq, RAQM_DIRECTION_DEFAULT) ||
+		!raqm_layout (rq)) {
+		raqm_destroy (rq);
+		return 0;
+	}
+
+	glyphs = raqm_get_glyphs (rq, &count);
+	if (!glyphs) {
+		raqm_destroy (rq);
+		return 0;
+	}
+
+	info = (glyphInfo*) gdMalloc (sizeof (glyphInfo) * count);
+	if (!info) {
+		raqm_destroy (rq);
+		return 0;
+	}
+
+	for (i = 0; i < count; i++) {
+		info[i].index = glyphs[i].index;
+		info[i].x_offset = glyphs[i].x_offset;
+		info[i].y_offset = glyphs[i].y_offset;
+		info[i].x_advance = glyphs[i].x_advance;
+		info[i].cluster = glyphs[i].cluster;
+	}
+
+	raqm_destroy (rq);
+#else
+	FT_UInt glyph_index = 0, previous = 0;
+	FT_Vector delta;
+	FT_Error err;
+	info = (glyphInfo*) gdMalloc (sizeof (glyphInfo) * len);
+	if (!info) {
+		return 0;
+	}
+	for (count = 0; count < len; count++) {
+		/* Convert character code to glyph index */
+		glyph_index = FT_Get_Char_Index (face, text[count]);
+
+		/* retrieve kerning distance */
+		if (! (strex && (strex->flags & gdFTEX_DISABLE_KERNING))
+			&& ! FT_IS_FIXED_WIDTH(face)
+			&& FT_HAS_KERNING(face)
+			&& previous
+			&& glyph_index)
+			FT_Get_Kerning (face, previous, glyph_index, ft_kerning_default, &delta);
+		else
+			delta.x = delta.y = 0;
+
+		err = FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT);
+		if (err) {
+			gdFree (info);
+			return 0;
+		}
+		info[count].index = glyph_index;
+		info[count].x_offset = 0;
+		info[count].y_offset = 0;
+		if (delta.x != 0)
+			info[count - 1].x_advance += delta.x;
+		info[count].x_advance = face->glyph->metrics.horiAdvance;
+		info[count].cluster = count;
+
+		/* carriage returns or newlines */
+		if (text[count] == '\r' || text[count] == '\n')
+			previous = 0;	/* clear kerning flag */
+		else
+			previous = glyph_index;
+	}
+#endif
+
+	*glyph_info = info;
+	return count;
+}
+
 /********************************************************************/
 /* font cache functions                                             */
 
@@ -475,7 +573,7 @@
 		gdFree(a);
 		return "could not alloc full list of fonts";
 	}
-	strncpy(a->fontlist, b->fontlist, b_font_list_len);
+	memcpy(a->fontlist, b->fontlist, b_font_list_len);
 	a->fontlist[b_font_list_len] = 0;
 
 	a->flags = b->flags;
@@ -824,8 +922,8 @@
  * See also:
  *  - <gdImageString>
  */
-BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
-                                     double ptsize, double angle, int x, int y, char *string)
+BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, const char *fontlist,
+                                     double ptsize, double angle, int x, int y, const char *string)
 {
 	return gdImageStringFTEx (im, brect, fg, fontlist,
 	                          ptsize, angle, x, y, string, 0);
@@ -872,13 +970,13 @@
   typedef struct {
       // logical OR of gdFTEX_ values
       int flags;
-   
+
       // fine tune line spacing for '\n'
       double linespacing;
-   
+
       // Preferred character mapping
       int charmap;
-   
+
       // Rendering resolution
       int hdpi;
       int vdpi;
@@ -982,7 +1080,7 @@
 
     > flags | gdFTEX_FONTPATHNAME;
 
-  For more information, see <gdImageStringFT>. 
+  For more information, see <gdImageStringFT>.
 */
 
 /* the platform-independent resolution used for size and position calculations */
@@ -989,25 +1087,28 @@
 /*    the size of the error introduced by rounding is affected by this number */
 #define METRIC_RES 300
 
-BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
-                                       double ptsize, double angle, int x, int y, char *string,
+BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, const char *fontlist,
+                                       double ptsize, double angle, int x, int y, const char *string,
                                        gdFTStringExtraPtr strex)
 {
 	FT_Matrix matrix;
-	FT_Vector penf, oldpenf, delta, total_min = {0,0}, total_max = {0,0}, glyph_min, glyph_max;
+	FT_Vector penf, oldpenf, total_min = {0,0}, total_max = {0,0}, glyph_min, glyph_max;
 	FT_Face face;
 	FT_CharMap charmap = NULL;
 	FT_Glyph image;
 	FT_GlyphSlot slot;
 	FT_Error err;
-	FT_UInt glyph_index, previous;
+	FT_UInt glyph_index;
 	double sin_a = sin (angle);
 	double cos_a = cos (angle);
-	int len, i, ch;
+	int  i, ch;
 	font_t *font;
 	fontkey_t fontkey;
-	char *next;
+	const char *next;
 	char *tmpstr = 0;
+	uint32_t *text;
+	glyphInfo *info = NULL;
+	size_t count;
 	int render = (im && (im->trueColor || (fg <= 255 && fg >= -255)));
 	FT_BitmapGlyph bm;
 	/* 2.0.13: Bob Ostermann: don't force autohint, that's just for testing
@@ -1100,7 +1201,7 @@
 				gdMutexUnlock(gdFontCacheMutex);
 				return "could not alloc full list of fonts";
 			}
-			strncpy(strex->fontpath, font->fontpath, fontpath_len);
+			memcpy(strex->fontpath, font->fontpath, fontpath_len);
 			strex->fontpath[fontpath_len] = 0;
 		}
 	}
@@ -1220,31 +1321,11 @@
 
 	oldpenf.x = oldpenf.y = 0; /* for postscript xshow operator */
 	penf.x = penf.y = 0;	/* running position of non-rotated glyphs */
-	previous = 0;		/* index of previous glyph for kerning calculations */
-	for (i=0; *next; i++) {
-		FT_Activate_Size (platform_independent);
-
+	text = (uint32_t*) gdCalloc (sizeof (uint32_t), strlen(next));
+	i = 0;
+	while (*next) {
+		int len;
 		ch = *next;
-
-		/* carriage returns */
-		if (ch == '\r') {
-			penf.x = 0;
-			previous = 0;		/* clear kerning flag */
-			next++;
-			continue;
-		}
-		/* newlines */
-		if (ch == '\n') {
-			/* 2.0.13: reset penf.x. Christopher J. Grayce */
-			penf.x = 0;
-			penf.y += linespace * ptsize * 64 * METRIC_RES / 72;
-			penf.y &= ~63;	/* round down to 1/METRIC_RES */
-			previous = 0;		/* clear kerning flag */
-			next++;
-			continue;
-		}
-
-
 		switch (encoding) {
 		case gdFTEX_Unicode: {
 			/* use UTF-8 mapping from ASCII */
@@ -1320,22 +1401,43 @@
 			next++;
 			break;
 		}
+		text[i] = ch;
+		i++;
+	}
 
-		/* Convert character code to glyph index */
-		glyph_index = FT_Get_Char_Index (face, ch);
+	FT_Activate_Size (platform_independent);
 
-		/* retrieve kerning distance */
-		if ( ! (strex && (strex->flags & gdFTEX_DISABLE_KERNING))
-		        && ! FT_IS_FIXED_WIDTH(face)
-		        && FT_HAS_KERNING(face)
-		        && previous
-		        && glyph_index)
-			FT_Get_Kerning (face, previous, glyph_index, ft_kerning_default, &delta);
-		else
-			delta.x = delta.y = 0;
+	count = textLayout (text , i, face, strex, &info);
 
-		penf.x += delta.x;
+	if (!count) {
+		gdFree (text);
+		gdFree (tmpstr);
+		gdCacheDelete (tc_cache);
+		gdMutexUnlock (gdFontCacheMutex);
+		return "Problem doing text layout";
+	}
 
+	for (i = 0; i < count; i++) {
+		FT_Activate_Size (platform_independent);
+
+		ch = text[info[i].cluster];
+
+		/* carriage returns */
+		if (ch == '\r') {
+			penf.x = 0;
+			continue;
+		}
+
+		/* newlines */
+		if (ch == '\n') {
+			/* 2.0.13: reset penf.x. Christopher J. Grayce */
+			penf.x = 0;
+			penf.y += linespace * ptsize * 64 * METRIC_RES / 72;
+			penf.y &= ~63;	/* round down to 1/METRIC_RES */
+			continue;
+		}
+
+		glyph_index = info[i].index;
 		/* When we know the position of the second or subsequent character,
 		save the (kerned) advance from the preceeding character in the
 		xshow vector */
@@ -1348,6 +1450,7 @@
 				if (!strex->xshow) {
 					if (tmpstr)
 						gdFree (tmpstr);
+					gdFree(text);
 					gdCacheDelete (tc_cache);
 					gdMutexUnlock (gdFontCacheMutex);
 					return "Problem allocating memory";
@@ -1359,6 +1462,7 @@
 				if (!strex->xshow) {
 					if (tmpstr)
 						gdFree (tmpstr);
+					gdFree(text);
 					gdCacheDelete (tc_cache);
 					gdMutexUnlock (gdFontCacheMutex);
 					return "Problem allocating memory";
@@ -1374,12 +1478,13 @@
 		if (err) {
 			if (tmpstr)
 				gdFree (tmpstr);
+			gdFree(text);
 			gdCacheDelete (tc_cache);
 			gdMutexUnlock (gdFontCacheMutex);
 			return "Problem loading glyph";
 		}
 
-		horiAdvance = slot->metrics.horiAdvance;
+		horiAdvance = info[i].x_advance;
 
 		if (brect) {
 			/* only if need brect */
@@ -1414,6 +1519,8 @@
 		}
 
 		if (render) {
+			FT_Pos pen_x;
+			FT_Pos pen_y;
 			FT_Activate_Size (platform_specific);
 
 			/* load glyph again into the slot (erase previous one)  - this time with scaling */
@@ -1421,6 +1528,7 @@
 			if (err) {
 				if (tmpstr)
 					gdFree (tmpstr);
+				gdFree(text);
 				gdCacheDelete (tc_cache);
 				gdMutexUnlock (gdFontCacheMutex);
 				return "Problem loading glyph";
@@ -1435,6 +1543,7 @@
 					FT_Done_Glyph(image);
 					if (tmpstr)
 						gdFree (tmpstr);
+					gdFree(text);
 					gdCacheDelete (tc_cache);
 					gdMutexUnlock (gdFontCacheMutex);
 					return "Problem rendering glyph";
@@ -1445,19 +1554,22 @@
 			bm = (FT_BitmapGlyph) image;
 			/* position rounded down to nearest pixel at current dpi
 			(the estimate was rounded up to next 1/METRIC_RES, so this should fit) */
+			pen_x = penf.x + info[i].x_offset;
+			pen_y = penf.y - info[i].y_offset;
 			gdft_draw_bitmap (tc_cache, im, fg, bm->bitmap,
-			                  (int)(x + (penf.x * cos_a + penf.y * sin_a)*hdpi/(METRIC_RES*64) + bm->left),
-			                  (int)(y - (penf.x * sin_a - penf.y * cos_a)*vdpi/(METRIC_RES*64) - bm->top));
+					  (int)(x + (pen_x * cos_a + pen_y * sin_a)*hdpi/(METRIC_RES*64) + bm->left),
+					  (int)(y - (pen_x * sin_a - pen_y * cos_a)*vdpi/(METRIC_RES*64) - bm->top));
 
 			FT_Done_Glyph (image);
 		}
 
-		/* record current glyph index for kerning */
-		previous = glyph_index;
 
 		penf.x += horiAdvance;
 	}
 
+	gdFree(text);
+	gdFree(info);
+
 	/* Save the (unkerned) advance from the last character in the xshow vector */
 	if (strex && (strex->flags & gdFTEX_XSHOW) && strex->xshow) {
 		sprintf(strex->xshow + xshow_pos, "%g",
@@ -1469,12 +1581,6 @@
 		double scalex = (double)hdpi / (64 * METRIC_RES);
 		double scaley = (double)vdpi / (64 * METRIC_RES);
 
-		/* increase by 1 pixel to allow for rounding */
-		total_min.x -= METRIC_RES;
-		total_min.y -= METRIC_RES;
-		total_max.x += METRIC_RES;
-		total_max.y += METRIC_RES;
-
 		/* rotate bounding rectangle, scale and round to int pixels, and translate */
 		brect[0] = x + (total_min.x * cos_a + total_max.y * sin_a)*scalex;
 		brect[1] = y - (total_min.x * sin_a - total_max.y * cos_a)*scaley;
@@ -1656,7 +1762,7 @@
 		if (*fontpath == NULL) {
 			return "could not alloc font path";
 		}
-		strncpy(*fontpath, (const char *)file, file_len);
+		memcpy(*fontpath, (const char *)file, file_len);
 		(*fontpath)[file_len] = 0;
 	}
 	FcPatternDestroy(font);
@@ -1685,11 +1791,11 @@
 	fontsearchpath = getenv ("GDFONTPATH");
 #ifdef _WIN32
         if (!fontsearchpath) {
-          char *ffptr = getenv ("SYSTEMROOT");
+          char *ffptr = getenv ("WINDIR");
           if (ffptr) {
-            fontsearchpath = malloc (strlen(ffptr) + strlen("\\fonts") + 1);
+            fontsearchpath = malloc (strlen(ffptr) + strlen("\\Fonts") + 1);
             strcpy(fontsearchpath, ffptr);
-            strcat(fontsearchpath, "\\fonts");
+            strcat(fontsearchpath, "\\Fonts");
           }
         }
 #endif
@@ -1706,7 +1812,7 @@
 		gdFree(path);
 		return "could not alloc full list of fonts";
 	}
-	strncpy(fontlist, name_list, name_list_len);
+	memcpy(fontlist, name_list, name_list_len);
 	fontlist[name_list_len] = 0;
 
 	/*
@@ -1731,14 +1837,9 @@
 			return "could not alloc full path of font";
 		}
 		/* if name is an absolute or relative pathname then test directly */
-#ifdef NETWARE
-		/* netware uses the format "volume:/path" or the standard "/path" */
-		if (name[0] != 0 && (strstr(name, ":/") || name[0] == '/'))
-#else
 		if (strchr (name, '/')
 		        || (name[0] != 0 && name[1] == ':'
 		            && (name[2] == '/' || name[2] == '\\')))
-#endif
 		{
 			sprintf (fullname, "%s", name);
 			if (access (fullname, R_OK) == 0) {
@@ -1820,4 +1921,3 @@
 	return 0;
 #endif /* HAVE_LIBFONTCONFIG */
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfx.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfx.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfx.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -522,4 +522,3 @@
 		}
 	}
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdfx.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdfx.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdfx.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,10 +1,10 @@
+#ifndef GDFX_H
+#define GDFX_H 1
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef GDFX_H
-#define GDFX_H 1
-
 BGD_DECLARE(gdImagePtr) gdImageSquareToCircle(gdImagePtr im, int radius);
 
 BGD_DECLARE(char *) gdImageStringFTCircle(
@@ -22,9 +22,8 @@
 
 BGD_DECLARE(void) gdImageSharpen (gdImagePtr im, int pct);
 
-#endif /* GDFX_H */
-
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* GDFX_H */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -114,5 +114,3 @@
 {
 	free (ptr);
 }
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdhelpers.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,10 +1,10 @@
+#ifndef GDHELPERS_H
+#define GDHELPERS_H 1
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef GDHELPERS_H
-#define GDHELPERS_H 1
-
 	/* sys/types.h is needed for size_t on Sparc-SunOS-4.1 */
 #ifndef _WIN32_WCE
 #include <sys/types.h>
@@ -69,8 +69,8 @@
 #define DPI2DPCM(dpi)  (unsigned int)((dpi)/2.54 + 0.5)
 #define DPI2DPM(dpi)   (unsigned int)((dpi)/0.0254 + 0.5)
 
-#endif /* GDHELPERS_H */
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* GDHELPERS_H */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdkanji.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdkanji.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdkanji.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -11,11 +11,7 @@
 #include "gd.h"
 #include "gdhelpers.h"
 #include "gd_errors.h"
-
-#ifdef HAVE_ERRNO_H
 #include <errno.h>
-#endif
-
 #include <stdarg.h>
 #if defined(HAVE_ICONV_H)
 #include <iconv.h>
@@ -98,7 +94,7 @@
 /* DetectKanjiCode() derived from DetectCodeType() by Ken Lunde. */
 
 static int
-DetectKanjiCode (unsigned char *str)
+DetectKanjiCode (const unsigned char *str)
 {
 	static int whatcode = ASCII;
 	int oldcode = ASCII;
@@ -146,7 +142,7 @@
 					whatcode = EUCORSJIS;
 				else if (c >= 224 && c <= 239) {
 					whatcode = EUCORSJIS;
-					while (c >= 64 && c != '\0' && whatcode == EUCORSJIS) {
+					while (c >= 64 && whatcode == EUCORSJIS) {
 						if (c >= 129) {
 							if (c <= 141 || (c >= 143 && c <= 159))
 								whatcode = SJIS;
@@ -334,10 +330,10 @@
 #define ustrncpy(A,B, maxsize) (strncpy((char*)(A),(const char*)(B), maxsize))
 
 static void
-do_convert (unsigned char **to_p, unsigned char **from_p, const char *code)
+do_convert (unsigned char **to_p, const unsigned char **from_p, const char *code)
 {
 	unsigned char *to = *to_p;
-	unsigned char *from = *from_p;
+	const unsigned char *from = *from_p;
 #ifdef HAVE_ICONV
 	iconv_t cd;
 	size_t from_len, to_len;
@@ -344,10 +340,10 @@
 
 	if ((cd = iconv_open (EUCSTR, code)) == (iconv_t) - 1) {
 		gd_error ("iconv_open() error");
-#ifdef HAVE_ERRNO_H
+
 		if (errno == EINVAL)
 			gd_error ("invalid code specification: \"%s\" or \"%s\"", EUCSTR, code);
-#endif
+
 		ustrcpy (to, from);
 		return;
 	}
@@ -357,7 +353,7 @@
 
 	if ((int) (iconv (cd, (char **)from_p, &from_len, (char **)to_p, &to_len))
 	        == -1) {
-#ifdef HAVE_ERRNO_H
+
 		if (errno == EINVAL)
 			gd_error ("invalid end of input string");
 		else if (errno == EILSEQ)
@@ -365,7 +361,7 @@
 		else if (errno == E2BIG)
 			gd_error ("output buffer overflow at do_convert()");
 		else
-#endif
+
 			gd_error ("something happen");
 		ustrcpy (to, from);
 		return;
@@ -436,7 +432,7 @@
 }
 
 static int
-do_check_and_conv (unsigned char *to, unsigned char *from)
+do_check_and_conv (unsigned char *to, const unsigned char *from)
 {
 	static unsigned char tmp[BUFSIZ];
 	unsigned char *tmp_p = &tmp[0];
@@ -527,7 +523,7 @@
 }
 
 int
-any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max)
+any2eucjp (unsigned char *dest, const unsigned char *src, unsigned int dest_max)
 {
 	static unsigned char tmp_dest[BUFSIZ];
 	int ret;

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdparttopng.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdparttopng.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdparttopng.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -49,11 +48,7 @@
 		gdImageDestroy (im);
 		exit (1);
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng (im, out);
-#else
-	fprintf(stderr, "No PNG library support.\n");
-#endif
 	fclose (out);
 	gdImageDestroy (im);
 

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdpp.cxx
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdpp.cxx	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdpp.cxx	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 /* *****************************************************************************
-** $Id$
 ** Initial file written and documented by:
 ** Kevin Shepherd <kshepherd at php.net> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -6,7 +5,7 @@
 *******************************************************************************/
 /** \file gdpp.cxx
 	\brief Implements the non-trivial methods of GD::Image.
-	
+
 	Implementation of the more complex methods defined
 	in gdpp.h.
 	Notably includes the methods which determine the image file
@@ -19,13 +18,13 @@
 	{
 	/**
 		Load an image from a file, after attempting to
-		determine it's image file format. 
+		determine it's image file format.
 		Invoke CreateFrom with an already opened
-		pointer to a file containing the desired image. 
+		pointer to a file containing the desired image.
 		CreateFrom does not close the file.
 		\param[in] in An opened FILE * pointer.
-		\return true for success, or false if unable to load the image (most often because the 
-		file is corrupt or does not contain a recognized image format). 
+		\return true for success, or false if unable to load the image (most often because the
+		file is corrupt or does not contain a recognized image format).
 		You can call Width() and Height() member functions of the image to determine its size.
 	*/
 	bool Image::CreateFrom(FILE * in)
@@ -40,11 +39,10 @@
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
 		   == .PNG\r\n.\n
 		*/
-#ifdef HAVE_LIBPNG
 		case 0x89: // PNG
 			rtn = CreateFromPng(in);
 			break;
-#endif
+
 		/* GIF
 			0x47 0x49 0x46
 		*/
@@ -51,25 +49,23 @@
 		case 0x47: // GIF
 			rtn = CreateFromGif(in);
 			break;
-#ifdef HAVE_LIBJPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
-		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
+		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
 		*/
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(in);
 			break;
-#endif
 		/* WBMP
-		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
+		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
 		*/
 		case 0x00: // WBMP
 			rtn = CreateFromWBMP(in);
 			break;
 		/* GD2
-			0x67 0x64 0x32 0x00 
+			0x67 0x64 0x32 0x00
 			== GD2\0
-		Starts with gd2 
+		Starts with gd2
 		*/
 		case 0x67: // GD2
 			rtn = CreateFromGd2(in);
@@ -76,14 +72,14 @@
 			break;
 		/* GD
 			0xFF 0xFE
-			or 
-			0xFF 0xFF 
+			or
+			0xFF 0xFF
 			Conflicts with Jpeg
 		*/
 		/* XBM
 			#define test_width 16
 			#define test_height 7
-		*/	
+		*/
 		case 0x23: // XBM
 			rtn = CreateFromXbm(in);
 			break;
@@ -91,18 +87,18 @@
 			rtn = false;
 			break;
 			}
-		return rtn; 
+		return rtn;
 		}
 
 	/**
 		Load an image from a standard input stream, after attempting to
-		determine it's image file format. 
+		determine it's image file format.
 		Invoke CreateFrom with an already opened stream
-		containing the desired image. 
+		containing the desired image.
 		CreateFrom does not close the stream.
 		\param[in] in An opened standard library input stream.
-		\return true for success, or false if unable to load the image (most often because the 
-		file is corrupt or does not contain a recognized image format). 
+		\return true for success, or false if unable to load the image (most often because the
+		file is corrupt or does not contain a recognized image format).
 		You can call Width() and Height() member functions of the image to determine its size.
 		Example usage, convert anything to gif:
 		#include <fstream>
@@ -122,7 +118,6 @@
 		bool rtn;
 		switch (in.peek())
 			{
-#ifdef HAVE_LIBPNG
 		/* PNG
 		The first eight bytes of a PNG file always contain the following (decimal) values:
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
@@ -131,7 +126,6 @@
 		case 0x89: // PNG
 			rtn = CreateFromPng(in);
 			break;
-#endif
 
 		/* GIF
 			0x47 0x49 0x46
@@ -140,26 +134,24 @@
 			rtn = CreateFromGif(in);
 			break;
 
-#ifdef HAVE_LIBJPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
-		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
+		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
 		*/
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(in);
 			break;
-#endif
 
 		/* WBMP
-		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
+		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
 		*/
 		case 0x00: // WBMP
 			rtn = CreateFromWBMP(in);
 			break;
 		/* GD2
-			0x67 0x64 0x32 0x00 
+			0x67 0x64 0x32 0x00
 			== GD2\0
-		Starts with gd2 
+		Starts with gd2
 		*/
 		case 0x67: // GD2
 			rtn = CreateFromGd2(in);
@@ -166,8 +158,8 @@
 			break;
 		/* GD
 			0xFF 0xFE
-			or 
-			0xFF 0xFF 
+			or
+			0xFF 0xFF
 			Conflicts with Jpeg
 		*/
 		default:
@@ -174,17 +166,17 @@
 			rtn = false;
 			break;
 			}
-		return rtn; 
+		return rtn;
 		}
 
 	/**
 		Load an image from an in-RAM memory block, after attempting to
-		determine it's image format. 
+		determine it's image format.
 		CreateFrom does not de-allocate the memory.
 		\param[in] size The byte count of the memory block.
 		\param[in] data A pointer to the memory block.
-		\return true for success, or false if unable to load the image (most often because the 
-		formatting is corrupt or does not contain a recognized image format). 
+		\return true for success, or false if unable to load the image (most often because the
+		formatting is corrupt or does not contain a recognized image format).
 		You can call Width() and Height() member functions of the image to determine its size.
 	*/
 	bool Image::CreateFrom(int size, void * data)
@@ -193,7 +185,6 @@
 		switch (((unsigned char * )data)[0])
 			{
 
-#ifdef HAVE_LIBPNG
 		/* PNG
 		The first eight bytes of a PNG file always contain the following (decimal) values:
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
@@ -202,7 +193,7 @@
 		case 0x89: // PNG
 			rtn = CreateFromPng(size, data);
 			break;
-#endif
+
 		/* GIF
 			0x47 0x49 0x46
 		*/
@@ -210,26 +201,24 @@
 			rtn = CreateFromGif(size, data);
 			break;
 
-#ifdef HAVE_LIBJPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
-		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
+		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
 		*/
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(size, data);
 			break;
-#endif
 
 		/* WBMP
-		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
+		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
 		*/
 		case 0x00: // WBMP
 			rtn = CreateFromWBMP(size, data);
 			break;
 		/* GD2
-			0x67 0x64 0x32 0x00 
+			0x67 0x64 0x32 0x00
 			== GD2\0
-		Starts with gd2 
+		Starts with gd2
 		*/
 		case 0x67: // GD2
 			rtn = CreateFromGd2(size, data);
@@ -236,8 +225,8 @@
 			break;
 		/* GD
 			0xFF 0xFE
-			or 
-			0xFF 0xFF 
+			or
+			0xFF 0xFF
 			Conflicts with Jpeg
 		*/
 		default:
@@ -244,11 +233,11 @@
 			rtn = false;
 			break;
 			}
-		return rtn; 
+		return rtn;
 		}
 	} // namespace GD
 /**
-	Load an image from a standard input stream, regardless of it's image file format. 
+	Load an image from a standard input stream, regardless of it's image file format.
 	You can call Width() and Height() member functions of the image to determine its size.
 	Example usage, convert anything to gif:
 	#include <fstream>

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdpp.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdpp.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdpp.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 /* *****************************************************************************
-** $Id$
 ** Initial file written and documented by:
 ** Kevin Shepherd <kshepherd at php.net> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -20,14 +19,10 @@
 		im.Gif(out);
 		}
 */
-#ifdef __cplusplus
 #ifndef _gdpp_h
 #define _gdpp_h
+#ifdef __cplusplus
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include "gd_io_stream.h"
 #include <string>
 
@@ -292,7 +287,7 @@
 		:im(0) {
 		CreateFrom(size, data);
 	}
-#ifdef HAVE_LIBPNG
+
 	/** Construct an image by reading from \p in.
 		The tag is an empty struct which simply tells the compiler which image read function to use.
 		e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input
@@ -330,7 +325,6 @@
 		:im(0) {
 		CreateFromPng(size, data);
 	}
-#endif
 
 	/** Construct an image by reading from \p in.
 		The tag is an empty struct which simply tells the compiler which image read function to use.
@@ -408,7 +402,6 @@
 		CreateFromWBMP(size, data);
 	}
 
-#ifdef HAVE_LIBJPEG
 	/** Construct an image by reading from \p in.
 		The tag is an empty struct which simply tells the compiler which image read function to use.
 		e.g. GD::Image img(input, GD::Jpeg_tag()); // read a jpeg file from input
@@ -446,7 +439,6 @@
 		:im(0) {
 		CreateFromJpeg(size, data);
 	}
-#endif
 
 	/** Construct an image by reading from \p in.
 		The tag is an empty struct which simply tells the compiler which image read function to use.
@@ -608,7 +600,6 @@
 	/// Read an image from a memory block, after determining the image format
 	bool CreateFrom(int size, void * data);
 
-#ifdef HAVE_LIBPNG
 	// Png
 	bool CreateFromPng(FILE * in) {
 		clear();
@@ -627,7 +618,6 @@
 		istreamIOCtx _in_ctx(in);
 		return ((im = gdImageCreateFromPngCtx( & _in_ctx)) != 0);
 	}
-#endif
 
 	// Gif
 	bool CreateFromGif(FILE * in) {
@@ -666,7 +656,6 @@
 		return ((im = gdImageCreateFromWBMPCtx( & _in_ctx)) != 0);
 	}
 
-#ifdef HAVE_LIBJPEG
 	// Jpeg
 	/**
 		Load a truecolor image from a JPEG format file.
@@ -720,7 +709,6 @@
 		istreamIOCtx _in_ctx(in);
 		return ((im = gdImageCreateFromJpegCtx( & _in_ctx)) != 0);
 	}
-#endif
 
 	// Gd
 	bool CreateFromGd(FILE * in) {
@@ -1089,7 +1077,6 @@
 		gdImageGifCtx(im, & _out_ctx);
 	}
 
-#ifdef HAVE_LIBPNG
 	/**
 		Write out this image in PNG file format to \p out.
 		\param out A FILE * handle
@@ -1154,7 +1141,6 @@
 		ostreamIOCtx _out_ctx(out);
 		gdImagePngCtxEx(im, & _out_ctx, level);
 	}
-#endif
 
 	/**
 		Write out this image in WBMP file format ( black and white only ) to \p out.
@@ -1191,7 +1177,6 @@
 		gdImageWBMPCtx(im, fg, & _out_ctx);
 	}
 
-#ifdef HAVE_LIBJPEG
 	/**
 		Write out this image in JPEG file format to \p out.
 		\param out A FILE * handle
@@ -1226,7 +1211,6 @@
 		ostreamIOCtx _out_ctx(out);
 		gdImageJpegCtx(im, & _out_ctx, quality);
 	}
-#endif
 
 	void GifAnimBegin(FILE * out, int GlobalCM, int Loops) const {
 		gdImageGifAnimBegin(im, out, GlobalCM, Loops);
@@ -1542,5 +1526,5 @@
 /// Read in an image from a standard library input stream
 std::istream & operator>> (std::istream & in, GD::Image & img);
 
+#endif /* __cplusplus */
 #endif /* _gdpp_h */
-#endif /* __cplusplus */

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdtables.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdtables.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdtables.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 const int gdCosT[] = {
 	1024,
 	1023,

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdtest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdtest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdtest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -24,7 +24,6 @@
 int
 main (int argc, char **argv)
 {
-#ifdef HAVE_LIBPNG
 	gdImagePtr im, ref, im2, im3;
 	FILE *in, *out;
 	void *iptr;
@@ -87,12 +86,12 @@
 	}
 	im2 = gdImageCreateFromPng (in);
 	fclose (in);
-	
+
 	if (!im2) {
 		fprintf(stderr, "gdImageCreateFromPng failed.\n");
 		exit (1);
 	}
-	
+
 	CompareImages ("GD->PNG File->GD", ref, im2);
 
 	unlink (of);
@@ -196,7 +195,7 @@
 		fprintf(stderr, "gdImageCreateFromGdPtr failed.\n");
 		exit (1);
 	}
-	
+
 	CompareImages ("GD->GD ptr->GD", ref, im2);
 
 	gdImageDestroy (im2);
@@ -409,9 +408,6 @@
 	}
 	gdImageDestroy (im);
 	gdImageDestroy (ref);
-#else
-	fprintf(stderr, "No PNG library support.\n");
-#endif /* HAVE_LIBPNG */
 
 	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdtestft.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdtestft.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdtestft.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -26,13 +25,6 @@
 int
 main (int argc, char *argv[])
 {
-#ifndef HAVE_LIBFREETYPE
-	fprintf(stderr, "gd was not compiled with HAVE_LIBFREETYPE defined.\n");
-	fprintf(stderr, "Install the FreeType library, including the\n");
-	fprintf(stderr, "header files. Then edit the gd Makefile, type\n");
-	fprintf(stderr, "make clean, and type make again.\n");
-	return 1;
-#else
 	gdImagePtr im;
 	int blue;
 	int blueAlpha;
@@ -40,7 +32,6 @@
 	int brect[8];
 	int x, y, sx, sy;
 	char *err;
-	FILE *out;
 #ifdef JISX0208
 	char *s = "Hello. \x82\xB1\x82\xF1\x82ɂ\xBF\x82\xCD Qyjpqg,";	/* String to draw. */
 #else
@@ -155,7 +146,7 @@
 	/* TBB: Write img to test/fttest.jpg or test/fttest.png */
 	if (im->trueColor) {
 #ifdef HAVE_LIBJPEG
-		out = fopen ("test/fttest.jpg", "wb");
+		FILE *out = fopen ("test/fttest.jpg", "wb");
 		if (!out) {
 			fprintf(stderr, "Can't create test/fttest.jpg\n");
 			exit (1);
@@ -169,7 +160,7 @@
 #endif
 	} else {
 #ifdef HAVE_LIBPNG
-		out = fopen ("test/fttest.png", "wb");
+		FILE *out = fopen ("test/fttest.png", "wb");
 		if (!out) {
 			fprintf(stderr, "Can't create test/fttest.png\n");
 			exit (1);
@@ -186,5 +177,4 @@
 	gdImageDestroy (im);
 
 	return 0;
-#endif /* HAVE_LIBFREETYPE */
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/gdtopng.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gdtopng.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gdtopng.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -38,11 +37,7 @@
 		gdImageDestroy (im);
 		exit (1);
 	}
-#ifdef HAVE_LIBPNG
 	gdImagePng (im, out);
-#else
-	fprintf(stderr, "No PNG library support.\n");
-#endif
 	fclose (out);
 	gdImageDestroy (im);
 

Added: trunk/Build/source/libs/gd/libgd-src/src/getopt.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/getopt.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/src/getopt.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,129 @@
+/*	$NetBSD: getopt.c,v 1.29 2014/06/05 22:00:22 christos Exp $	*/
+
+/*
+ * Copyright (c) 1987, 1993, 1994
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int	opterr = 1,		/* if error message should be printed */
+	optind = 1,		/* index into parent argv vector */
+	optopt,			/* character checked for validity */
+	optreset;		/* reset getopt */
+char	*optarg;		/* argument associated with option */
+
+#define	BADCH	(int)'?'
+#define	BADARG	(int)':'
+#define	EMSG	""
+
+/*
+ * getopt --
+ *	Parse argc/argv argument vector.
+ */
+int
+getopt(int nargc, char * const nargv[], const char *ostr)
+{
+	static const char *place = EMSG;	/* option letter processing */
+	char *oli;				/* option letter list index */
+
+	if (optreset || *place == 0) {		/* update scanning pointer */
+		optreset = 0;
+		place = nargv[optind];
+		if (optind >= nargc || *place++ != '-') {
+			/* Argument is absent or is not an option */
+			place = EMSG;
+			return (-1);
+		}
+		optopt = *place++;
+		if (optopt == '-' && *place == 0) {
+			/* "--" => end of options */
+			++optind;
+			place = EMSG;
+			return (-1);
+		}
+		if (optopt == 0) {
+			/* Solitary '-', treat as a '-' option
+			   if the program (eg su) is looking for it. */
+			place = EMSG;
+			if (strchr(ostr, '-') == NULL)
+				return -1;
+			optopt = '-';
+		}
+	} else
+		optopt = *place++;
+
+	/* See if option letter is one the caller wanted... */
+	if (optopt == ':' || (oli = strchr(ostr, optopt)) == NULL) {
+		if (*place == 0)
+			++optind;
+		if (opterr && *ostr != ':')
+			(void)fprintf(stderr,
+			    "%s: unknown option -- %c\n", nargv[0],
+			    optopt);
+		return (BADCH);
+	}
+
+	/* Does this option need an argument? */
+	if (oli[1] != ':') {
+		/* don't need argument */
+		optarg = NULL;
+		if (*place == 0)
+			++optind;
+	} else {
+		/* Option-argument is either the rest of this argument or the
+		   entire next argument. */
+		if (*place)
+			optarg = (char *)place;
+		else if (oli[2] == ':')
+			/*
+			 * GNU Extension, for optional arguments if the rest of
+			 * the argument is empty, we return NULL
+			 */
+			optarg = NULL;
+		else if (nargc > ++optind)
+			optarg = nargv[optind];
+		else {
+			/* option-argument absent */
+			place = EMSG;
+			if (*ostr == ':')
+				return (BADARG);
+			if (opterr)
+				(void)fprintf(stderr,
+				    "%s: option requires an argument -- %c\n",
+				    nargv[0], optopt);
+			return (BADCH);
+		}
+		place = EMSG;
+		++optind;
+	}
+	return (optopt);			/* return option letter */
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/src/getopt.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/src/gifanimtest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/gifanimtest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/gifanimtest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -32,4 +32,3 @@
 	gdImageDestroy(im);
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/giftogd2.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/giftogd2.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/giftogd2.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -49,4 +49,3 @@
 
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/src/jisx0208.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/jisx0208.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/jisx0208.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,9 +1,9 @@
+#ifndef JISX0208_H
+#define JISX0208_H
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef JISX0208_H
-#define JISX0208_H
 	/* This file was derived from "src/VF_Ftype.c" in VFlib2-2.24.2
 	   by Dr. Kakugawa */
 
@@ -1299,8 +1299,8 @@
 		}
 	};
 
-#endif /* JISX0208_H */
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* JISX0208_H */

Modified: trunk/Build/source/libs/gd/libgd-src/src/msinttypes/inttypes.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/msinttypes/inttypes.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/msinttypes/inttypes.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,21 +1,21 @@
 // ISO C9x  compliant inttypes.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
-// 
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
 //  Copyright (c) 2006 Alexander Chemeris
-// 
+//
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are met:
-// 
+//
 //   1. Redistributions of source code must retain the above copyright notice,
 //      this list of conditions and the following disclaimer.
-// 
+//
 //   2. Redistributions in binary form must reproduce the above copyright
 //      notice, this list of conditions and the following disclaimer in the
 //      documentation and/or other materials provided with the distribution.
-// 
+//
 //   3. The name of the author may be used to endorse or promote products
 //      derived from this software without specific prior written permission.
-// 
+//
 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@@ -22,11 +22,11 @@
 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// 
+//
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifndef _MSC_VER // [

Modified: trunk/Build/source/libs/gd/libgd-src/src/msinttypes/stdint.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/msinttypes/stdint.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/msinttypes/stdint.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,21 +1,21 @@
 // ISO C9x  compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
-// 
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
 //  Copyright (c) 2006-2008 Alexander Chemeris
-// 
+//
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are met:
-// 
+//
 //   1. Redistributions of source code must retain the above copyright notice,
 //      this list of conditions and the following disclaimer.
-// 
+//
 //   2. Redistributions in binary form must reproduce the above copyright
 //      notice, this list of conditions and the following disclaimer in the
 //      documentation and/or other materials provided with the distribution.
-// 
+//
 //   3. The name of the author may be used to endorse or promote products
 //      derived from this software without specific prior written permission.
-// 
+//
 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@@ -22,11 +22,11 @@
 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// 
+//
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifndef _MSC_VER // [

Modified: trunk/Build/source/libs/gd/libgd-src/src/pngtogd.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/pngtogd.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/pngtogd.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -25,11 +25,7 @@
 		fprintf (stderr, "Input file does not exist!\n");
 		exit (1);
 	}
-#ifdef HAVE_LIBPNG
 	im = gdImageCreateFromPng (in);
-#else
-	fprintf (stderr, "No PNG library support available.\n");
-#endif
 	fclose (in);
 	if (!im) {
 		fprintf (stderr, "Input is not in PNG format!\n");

Modified: trunk/Build/source/libs/gd/libgd-src/src/pngtogd2.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/pngtogd2.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/pngtogd2.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -30,12 +29,7 @@
 		fprintf(stderr, "Input file does not exist!\n");
 		exit (1);
 	}
-#ifdef HAVE_LIBPNG
 	im = gdImageCreateFromPng (in);
-#else
-	im = NULL;
-	fprintf(stderr, "No PNG library support available.\n");
-#endif
 	fclose (in);
 	if (!im) {
 		fprintf(stderr, "Input is not in PNG format!\n");

Added: trunk/Build/source/libs/gd/libgd-src/src/snprintf.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/snprintf.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/src/snprintf.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,25 @@
+/* Provide a snprintf on Windows for older Visual Studio builds.
+ * VS2013 and older do not support C99 snprintf(). The subsitute _snprintf()
+ * does not correctly NUL-terminate buffers in case of overflow.
+ * This implementation emulates the ISO C99 snprintf() for VS2013 and older.
+ */
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+
+#include <stdio.h>
+#include <stdarg.h>
+
+int snprintf(char* buf, size_t len, const char* fmt, ...)
+{
+  int n;
+  va_list ap;
+  va_start(ap, fmt);
+
+  n = _vscprintf(fmt, ap);
+  vsnprintf_s(buf, len, _TRUNCATE, fmt, ap);
+
+  va_end(ap);
+  return n;
+}
+
+#endif


Property changes on: trunk/Build/source/libs/gd/libgd-src/src/snprintf.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/src/testac.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/testac.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/testac.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -17,7 +16,6 @@
 int
 main (int argc, char *argv[])
 {
-#ifdef HAVE_LIBPNG
 	/* Input and output files */
 	FILE *in;
 
@@ -55,9 +53,6 @@
 	testDrawing (im_in, 2.0, 0, 1, "noblending-doublesize-palette.png");
 	testDrawing (im_in, 2.0, 1, 1, "blending-doublesize-palette.png");
 	gdImageDestroy (im_in);
-#else
-	fprintf (stderr, "No PNG library support.\n");
-#endif
 
 	return 0;
 }
@@ -116,11 +111,7 @@
 		gdImageTrueColorToPalette (im_out, 1, 256);
 	}
 
-#ifdef HAVE_LIBPNG
 	gdImagePng (im_out, out);
-#else
-	fprintf (stderr, "No PNG library support.\n");
-#endif
 	fclose (out);
 
 	gdImageDestroy (im_out);

Modified: trunk/Build/source/libs/gd/libgd-src/src/testtr.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/testtr.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/testtr.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -11,8 +11,6 @@
 int
 main(void)
 {
-#ifdef HAVE_LIBFREETYPE
-	FILE *out;
 	int transparent, green, black;
 	gdImagePtr im;
 
@@ -37,9 +35,11 @@
 
 	gdImageSaveAlpha (im, TRUE);
 #ifdef HAVE_LIBPNG
-	out = fopen ("testtr.png", "wb");
-	gdImagePng (im, out);
-	fclose (out);
+	{
+		FILE *out = fopen("testtr.png", "wb");
+		gdImagePng(im, out);
+		fclose(out);
+	}
 #else
 	fprintf(stderr, "Compiled without libpng support\n");
 #endif /* HAVE_LIBPNG */
@@ -46,8 +46,4 @@
 	gdImageDestroy (im);
 
 	return 0;
-#else
-	fprintf(stderr, "Compiled without freetype support\n");
-	return 0;
-#endif /* HAVE_LIBFREETYPE */
 }

Modified: trunk/Build/source/libs/gd/libgd-src/src/wbmp.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/wbmp.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/wbmp.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -38,7 +38,8 @@
  */
 int getmbi(int (*getin) (void *in), void *in)
 {
-	int i, mbi = 0;
+	unsigned int mbi = 0;
+	int i;
 
 	do {
 		i = getin(in);

Modified: trunk/Build/source/libs/gd/libgd-src/src/wbmp.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/wbmp.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/wbmp.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,3 @@
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 	/* WBMP
 	 * ----
 	 * WBMP Level 0: B/W, Uncompressed
@@ -16,6 +12,10 @@
 #ifndef __WBMP_H
 #define __WBMP_H	1
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 	/* WBMP struct
 	 * -----------
 	 * A Wireless bitmap structure
@@ -44,8 +44,8 @@
 	void freewbmp(Wbmp *wbmp);
 	void printwbmp(Wbmp *wbmp);
 
-#endif
-
 #ifdef __cplusplus
 }
 #endif
+
+#endif

Modified: trunk/Build/source/libs/gd/libgd-src/src/webpng.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/src/webpng.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/src/webpng.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -4,16 +4,10 @@
 
 /* Bring in standard I/O and string manipulation functions */
 #include <stdarg.h>
-#ifdef HAVE_ERRNO_H
 #include <errno.h>
-#endif
 #include <stdio.h>
-#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

Modified: trunk/Build/source/libs/gd/libgd-src/tests/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 if (BUILD_TEST)
 	SET(DART_TESTING_TIMEOUT 5)
 
@@ -28,15 +27,21 @@
 		gdimageclone
 		gdimagecolor
 		gdimagecolorclosest
+		gdimagecolorclosesthwb
 		gdimagecolordeallocate
 		gdimagecolorexact
+		gdimagecolormatch
 		gdimagecolorreplace
 		gdimagecolorresolve
 		gdimagecolortransparent
+		gdimagecompare
 		gdimagecontrast
 		gdimageconvolution
 		gdimagecopy
+		gdimagecopymerge
+		gdimagecopymergegray
 		gdimagecopyresampled
+		gdimagecopyresized
 		gdimagecopyrotated
 		gdimagecreate
 		gdimagecrop
@@ -49,6 +54,7 @@
 		gdimagefilltoborder
 		gdimagefilter
 		gdimageflip
+		gdimageellipse
 		gdimagegrayscale
 		gdimageline
 		gdimagenegate
@@ -59,9 +65,15 @@
 		gdimagerotate
 		gdimagescale
 		gdimagescatterex
+		gdimagesetinterpolationmethod
 		gdimagesetpixel
+		gdimagesquaretocircle
+		gdimagestring
+		gdimagestring16
 		gdimagestringft
 		gdimagestringftex
+		gdimagestringup
+		gdimagestringup16
 		gdimagetruecolortopalette
 		gdinterpolatedscale
 		gdnewfilectx
@@ -68,6 +80,7 @@
 		gdtest
 		gdtiled
 		gdtransformaffineboundingbox
+		gdtransformaffinecopy
 		gif
 		jpeg
 		png

Modified: trunk/Build/source/libs/gd/libgd-src/tests/Makefile.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/Makefile.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/Makefile.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -23,15 +23,21 @@
 include gdimageclone/Makemodule.am
 include gdimagecolor/Makemodule.am
 include gdimagecolorclosest/Makemodule.am
+include gdimagecolorclosesthwb/Makemodule.am
 include gdimagecolordeallocate/Makemodule.am
 include gdimagecolorexact/Makemodule.am
+include gdimagecolormatch/Makemodule.am
 include gdimagecolorreplace/Makemodule.am
 include gdimagecolorresolve/Makemodule.am
 include gdimagecolortransparent/Makemodule.am
+include gdimagecompare/Makemodule.am
 include gdimagecontrast/Makemodule.am
 include gdimageconvolution/Makemodule.am
 include gdimagecopy/Makemodule.am
+include gdimagecopymerge/Makemodule.am
+include gdimagecopymergegray/Makemodule.am
 include gdimagecopyresampled/Makemodule.am
+include gdimagecopyresized/Makemodule.am
 include gdimagecopyrotated/Makemodule.am
 include gdimagecreate/Makemodule.am
 include gdimagecrop/Makemodule.am
@@ -44,6 +50,7 @@
 include gdimagefilltoborder/Makemodule.am
 include gdimagefilter/Makemodule.am
 include gdimageflip/Makemodule.am
+include gdimageellipse/Makemodule.am
 include gdimagegrayscale/Makemodule.am
 include gdimageline/Makemodule.am
 include gdimagenegate/Makemodule.am
@@ -54,9 +61,15 @@
 include gdimagerotate/Makemodule.am
 include gdimagescale/Makemodule.am
 include gdimagescatterex/Makemodule.am
+include gdimagesetinterpolationmethod/Makemodule.am
 include gdimagesetpixel/Makemodule.am
+include gdimagesquaretocircle/Makemodule.am
+include gdimagestring/Makemodule.am
+include gdimagestring16/Makemodule.am
 include gdimagestringft/Makemodule.am
 include gdimagestringftex/Makemodule.am
+include gdimagestringup/Makemodule.am
+include gdimagestringup16/Makemodule.am
 include gdimagetruecolortopalette/Makemodule.am
 include gdinterpolatedscale/Makemodule.am
 include gdnewfilectx/Makemodule.am
@@ -63,6 +76,7 @@
 include gdtest/Makemodule.am
 include gdtiled/Makemodule.am
 include gdtransformaffineboundingbox/Makemodule.am
+include gdtransformaffinecopy/Makemodule.am
 include gif/Makemodule.am
 include jpeg/Makemodule.am
 include png/Makemodule.am

Modified: trunk/Build/source/libs/gd/libgd-src/tests/bmp/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,13 +1,9 @@
 LIST(APPEND TESTS_FILES
 	bmp_null
 	bug00275
-)
-
-IF(PNG_FOUND)
-LIST(APPEND TESTS_FILES
+	bug00450
 	bmp_im2im
 	bug00276
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/bmp/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,12 +1,10 @@
 libgd_test_programs += \
 	bmp/bmp_null \
-	bmp/bug00275
-
-if HAVE_LIBPNG
-libgd_test_programs += \
+	bmp/bug00275 \
+	bmp/bug00450 \
 	bmp/bmp_im2im \
 	bmp/bug00276
-endif
 
 EXTRA_DIST += \
+	bmp/bug00450.bmp \
 	bmp/CMakeLists.txt

Modified: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00275.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00275.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00275.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,7 +6,7 @@
 
 
 #ifdef __GNUC__
-#define UNUSED __attribute__((unused))
+#define UNUSED __attribute__((__unused__))
 #else
 #define UNUSED
 #endif
@@ -49,5 +49,7 @@
 	/* "save" the image as BMP */
 	gdImageBmpCtx(im, &ctx, 2);
 
+	gdImageDestroy(im);
+
 	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00276.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00276.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00276.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -28,5 +28,7 @@
 	gdImageDestroy(im_orig);
 	gdImageDestroy(im_saved);
 
+	gdFree(data);
+
 	return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.bmp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,40 @@
+#include <stdio.h>
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main(void) {
+	char *path = gdTestFilePath("bmp/bug00450.bmp");
+	gdImagePtr im = gdImageCreateFromFile(path);
+	gdTestAssert(im != NULL);
+
+	if (im) {
+		char const ref[] =
+			"#         "
+			"##        "
+			"###       "
+			"####      "
+			"#####     "
+			"######    "
+			"#######   "
+			"########  "
+			"######### "
+			"##########"
+			;
+		int x, y;
+
+		for (y = 0; y < 10; ++y) {
+			for (x = 0; x < 10; ++x) {
+				int const expected_pixel = ref[x + y * 10] == '#';
+				int const actual_pixel = gdImageGetPixel(im, x, y);
+				gdTestAssert(expected_pixel == actual_pixel);
+			}
+		}
+
+		gdImageDestroy(im);
+	}
+
+	free(path);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/bmp/bug00450.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/freetype/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/freetype/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/freetype/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,5 @@
 if HAVE_LIBFREETYPE
-if HAVE_LIBPNG 
+if HAVE_LIBPNG
 libgd_test_programs += \
 	freetype/bug00132
 endif

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,13 +1,14 @@
 LIST(APPEND TESTS_FILES
-	gd_null
-	gd_num_colors
 	gd_versiontest
 )
 
-IF(PNG_FOUND)
+IF(ENABLE_GD_FORMATS)
 LIST(APPEND TESTS_FILES
+	bug00383
+	gd_null
+	gd_num_colors
 	gd_im2im
 )
-ENDIF(PNG_FOUND)
+ENDIF(ENABLE_GD_FORMATS)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,13 +1,15 @@
 libgd_test_programs += \
-	gd/gd_null \
-	gd/gd_num_colors \
 	gd/gd_versiontest
 
-if HAVE_LIBPNG
+if ENABLE_GD_FORMATS
 libgd_test_programs += \
+	gd/bug00383 \
+	gd/gd_null \
+	gd/gd_num_colors \
 	gd/gd_im2im
 endif
 
 EXTRA_DIST += \
+	gd/bug00383.gd \
 	gd/crafted_num_colors.gd \
 	gd/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,32 @@
+/**
+ * Test that invalid transparent colors can't be read
+ *
+ * We're reading a corrupt palette image in GD format, which has only a single
+ * palette entry, but claims that the transparent color would be 1.  We check
+ * that the transparency is simply ignored in this case.
+ *
+ * See also <https://github.com/libgd/libgd/issues/383>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    FILE *fp;
+
+    fp = gdTestFileOpen2("gd", "bug00383.gd");
+    gdTestAssert(fp != NULL);
+    im = gdImageCreateFromGd(fp);
+    gdTestAssert(im != NULL);
+    fclose(fp);
+
+    gdTestAssert(gdImageGetTransparent(im) == -1);
+
+    gdImageDestroy(im);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd/bug00383.gd
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,25 +1,27 @@
+IF(ENABLE_GD_FORMATS)
+IF(ZLIB_FOUND)
 LIST(APPEND TESTS_FILES
 	bug_289
 	bug00209
 	bug00309
 	bug00354
+	bug00383
+	createimagefromgd2part
+	createimagefromgd2partptr
 	gd2_empty_file
 	php_bug_72339
+	gd2_null
 	gd2_read_corrupt
 	too_few_image_data
+	gd2_im2im
 )
 
-IF(ZLIB_FOUND)
-LIST(APPEND TESTS_FILES
-	gd2_null
-)
-
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
-	gd2_im2im
 	gd2_read
 )
 ENDIF(PNG_FOUND)
 ENDIF(ZLIB_FOUND)
+ENDIF(ENABLE_GD_FORMATS)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,23 +1,26 @@
+if ENABLE_GD_FORMATS
+if HAVE_LIBZ
 libgd_test_programs += \
 	gd2/bug_289 \
 	gd2/bug00209 \
 	gd2/bug00309 \
 	gd2/bug00354 \
+	gd2/bug00383 \
+	gd2/createimagefromgd2part \
+	gd2/createimagefromgd2partptr \
 	gd2/gd2_empty_file \
 	gd2/php_bug_72339 \
+	gd2/gd2_null \
 	gd2/gd2_read_corrupt \
-	gd2/too_few_image_data
+	gd2/too_few_image_data \
+	gd2/gd2_im2im
 
-if HAVE_LIBZ
-libgd_test_programs += \
-	gd2/gd2_null
-
 if HAVE_LIBPNG
 libgd_test_programs += \
-	gd2/gd2_im2im \
 	gd2/gd2_read
 endif
 endif
+endif
 
 EXTRA_DIST += \
 	gd2/CMakeLists.txt \
@@ -24,6 +27,7 @@
 	gd2/bug00209.gd2 \
 	gd2/bug00354a.gd2 \
 	gd2/bug00354b.gd2 \
+	gd2/bug00383.gd2 \
 	gd2/conv_gd2_exp.gd2 \
 	gd2/conv_test.gd2 \
 	gd2/conv_test_exp.png \

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00209.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00209.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00209.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,21 +8,19 @@
  * See <https://github.com/libgd/libgd/issues/209>.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
+	gdImagePtr im;
+	FILE *fp;
 
-    fp = gdTestFileOpen2("gd2", "bug00209.gd2");
-    gdTestAssert(fp != NULL);
-    im = gdImageCreateFromGd2(fp);
-    gdTestAssert(im == NULL);
-    fclose(fp);
+	fp = gdTestFileOpen2("gd2", "bug00209.gd2");
+	gdTestAssert(fp != NULL);
+	im = gdImageCreateFromGd2(fp);
+	gdTestAssert(im == NULL);
+	fclose(fp);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00354.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00354.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00354.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,27 +6,25 @@
  * See also <https://github.com/libgd/libgd/issues/354>.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
+	gdImagePtr im;
+	FILE *fp;
 
-    fp = gdTestFileOpen2("gd2", "bug00354a.gd2");
-    gdTestAssert(fp != NULL);
-    im = gdImageCreateFromGd2(fp);
-    gdTestAssert(im == NULL);
-    fclose(fp);
+	fp = gdTestFileOpen2("gd2", "bug00354a.gd2");
+	gdTestAssert(fp != NULL);
+	im = gdImageCreateFromGd2(fp);
+	gdTestAssert(im == NULL);
+	fclose(fp);
 
-    fp = gdTestFileOpen2("gd2", "bug00354b.gd2");
-    gdTestAssert(fp != NULL);
-    im = gdImageCreateFromGd2(fp);
-    gdTestAssert(im == NULL);
-    fclose(fp);
+	fp = gdTestFileOpen2("gd2", "bug00354b.gd2");
+	gdTestAssert(fp != NULL);
+	im = gdImageCreateFromGd2(fp);
+	gdTestAssert(im == NULL);
+	fclose(fp);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,32 @@
+/**
+ * Test that invalid transparent colors can't be read
+ *
+ * We're reading a corrupt palette image in GD2 format, which has only a single
+ * palette entry, but claims that the transparent color would be 1.  We check
+ * that the transparency is simply ignored in this case.
+ *
+ * See also <https://github.com/libgd/libgd/issues/383>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    FILE *fp;
+
+    fp = gdTestFileOpen2("gd2", "bug00383.gd2");
+    gdTestAssert(fp != NULL);
+    im = gdImageCreateFromGd2(fp);
+    gdTestAssert(im != NULL);
+    fclose(fp);
+
+    gdTestAssert(gdImageGetTransparent(im) == -1);
+
+    gdImageDestroy(im);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug00383.gd2
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug_289.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug_289.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/bug_289.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -29,5 +29,7 @@
     gdTestAssertMsg(buffer[12] == 0, MSG, "1st", 0, buffer[12]);
     gdTestAssertMsg(buffer[13] == GD2_FMT_TRUECOLOR_COMPRESSED, MSG, "2nd", GD2_FMT_TRUECOLOR_COMPRESSED, buffer[13]);
 
+    gdFree(buffer);
+
     return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2part.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2part.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2part.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,35 @@
+/**
+ *Base test for gdImageCreateFromGd2Part()
+ */
+#include "gd.h"
+#include "gdtest.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+	gdImagePtr im;
+	FILE *p;
+	int expected_color = 0xffffff;
+	int actual_color = 0;
+
+	p = gdTestFileOpen2("gd2", "conv_test.gd2");
+
+	if (!p) {
+		gdTestErrorMsg("failed, connot open gd2 file: conv_test.gd2");
+		return 1;
+	}
+
+	im = gdImageCreateFromGd2Part(p, 3, 3, 3, 3);
+	fclose(p);
+
+	if (!im) {
+		return 1;
+	}
+
+	actual_color = gdImageGetPixel(im, 2, 2);
+	gdImageDestroy(im);
+	gdTestAssert(expected_color == actual_color);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2part.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2partptr.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2partptr.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2partptr.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,59 @@
+/**
+ * Base test for gdImageCreateFromGd2PartPtr()
+ */
+#include "gd.h"
+#include "gdtest.h"
+#include <stdio.h>
+
+int main()
+{
+	FILE *p;
+	gdImagePtr im, partim;
+	void *pg;
+	int size = 0;
+	int status = 0;
+	int actual_color = 0;
+	int expected_color = 0xffffff;
+
+	p = gdTestFileOpen2("gd2", "conv_test.gd2");
+	if (!p) {
+		gdTestErrorMsg("failed, cannot open gd2 file:conv_test.gd2");
+		return 1;
+	}
+
+	im = gdImageCreateFromGd2(p);
+	fclose(p);
+
+	if (!im) {
+		gdTestErrorMsg("failed, cannot create gd2 file.");
+		return 1;
+	}
+
+	pg = gdImageGd2Ptr(im, (GD2_CHUNKSIZE_MIN + GD2_CHUNKSIZE_MAX) / 2, GD2_FMT_COMPRESSED, &size);
+	if (!pg) {
+		status = 1;
+		goto done1;
+	}
+
+	if (size <= 0) {
+		status = 1;
+		goto done0;
+	}
+
+	partim =  gdImageCreateFromGd2PartPtr(size, pg, 3, 3, 3, 3);
+	if (!partim) {
+		status = 1;
+		goto done0;
+	}
+
+	actual_color = gdImageGetPixel(partim, 2, 2);
+	status = (expected_color == actual_color) ? 0 : 1;
+	gdImageDestroy(partim);
+
+done0:
+	gdFree(pg);
+done1:
+	gdImageDestroy(im);
+
+	return status;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gd2/createimagefromgd2partptr.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/gd2_read.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/gd2_read.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/gd2_read.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -33,17 +33,18 @@
 			fp = gdTestFileOpen2("gd2", path_exp[i]);
 			if (!fp) {
 				gdTestErrorMsg("failed, cannot open file: %s\n", path_exp[i]);
+				gdImageDestroy(im);
 				return 1;
 			}
 			exp = gdImageCreateFromPng(fp);
 			if (!gdAssertImageEquals(exp, im)) {
 				gdTestErrorMsg("image %s differs from expected result\n", path[i]);
-				gdImageDestroy(im);
 				error = 1;
 			}
 			if (exp) {
 				gdImageDestroy(exp);
 			}
+			gdImageDestroy(im);
 		} else {
 			/* expected to fail */
 			if (im) {

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gd2/php_bug_72339.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gd2/php_bug_72339.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gd2/php_bug_72339.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -29,7 +29,7 @@
 
 	im = gdImageCreateFromGd2(fp);
 	fclose(fp);
-	
+
 	gdTestAssertMsg(im == NULL, "Image should have failed to be loaded\n");
 
 	return gdNumFailures();

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagebrightness/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagebrightness/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagebrightness/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,40 +2,36 @@
  * Basic test for gdImageBrightness()
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 static void test_brightness(int brightness);
 
-
 int main()
 {
-    test_brightness(+100);
-    test_brightness(-100);
+	test_brightness(+100);
+	test_brightness(-100);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }
 
-
 static void test_brightness(int brightness)
 {
-    gdImagePtr im;
-    FILE *fp;
-    char basename[256];
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char basename[256];
+	char *path;
 
-    fp = gdTestFileOpen2("gdimagebrightness", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimagebrightness", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    gdImageBrightness(im, brightness);
+	gdImageBrightness(im, brightness);
 
-    sprintf(basename, "basic%+03d.png", brightness);
-    path = gdTestFilePath2("gdimagebrightness", basename);
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	sprintf(basename, "basic%+03d.png", brightness);
+	path = gdTestFilePath2("gdimagebrightness", basename);
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,6 @@
 LIST(APPEND TESTS_FILES
 	bug00300
+	style
 )
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,6 @@
 libgd_test_programs += \
-	gdimageclone/bug00300
+	gdimageclone/bug00300 \
+	gdimageclone/style
 
 EXTRA_DIST += \
 	gdimageclone/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/style.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/style.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/style.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,30 @@
+/**
+ * Cloning an image should exactly reproduce all style related data
+ */
+
+
+#include <string.h>
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im, clone;
+    int style[] = {0, 0, 0};
+
+    im = gdImageCreate(8, 8);
+    gdImageSetStyle(im, style, sizeof(style)/sizeof(style[0]));
+
+    clone = gdImageClone(im);
+    gdTestAssert(clone != NULL);
+
+    gdTestAssert(clone->styleLength == im->styleLength);
+    gdTestAssert(clone->stylePos == im->stylePos);
+    gdTestAssert(!memcmp(clone->style, im->style, sizeof(style)/sizeof(style[0])));
+
+    gdImageDestroy(clone);
+    gdImageDestroy(im);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageclone/style.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolor/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolor/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolor/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,28 +2,26 @@
  * Basic test for gdImageColor()
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("gdimagecolor", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimagecolor", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    gdImageColor(im, 127, -127, -127, 0);
+	gdImageColor(im, 127, -127, -127, 0);
 
-    path = gdTestFilePath2("gdimagecolor", "basic_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimagecolor", "basic_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	gdimagecolorclosest
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosest/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagecolorclosest/gdimagecolorclosest
-endif
 
 EXTRA_DIST += \
 	gdimagecolorclosest/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdImageColorClosestHWB
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagecolorclosesthwb/gdImageColorClosestHWB
+endif
+
+EXTRA_DIST += \
+	gdimagecolorclosesthwb/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/gdImageColorClosestHWB.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/gdImageColorClosestHWB.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/gdImageColorClosestHWB.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,26 @@
+/**
+  * Basic test for gdImageColorClosestHWB()
+  **/
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	FILE *fp;
+
+	fp = gdTestFileOpen2("gdimageflip", "remi.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
+
+	int result = gdImageColorClosestHWB(im, 255, 0, 255);
+
+	if (gdTestAssert(result <= 0))
+	{
+		gdImageDestroy(im);
+		return 1;
+	}
+
+	gdImageDestroy(im);
+	return 0;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorclosesthwb/gdImageColorClosestHWB.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	gdimagecolorexact
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorexact/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagecolorexact/gdimagecolorexact
-endif
 
 EXTRA_DIST += \
 	gdimagecolorexact/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,6 @@
+LIST(APPEND TESTS_FILES
+	cve_2019_6977
+	gdimagecolormatch
+)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,6 @@
+libgd_test_programs += \
+	gdimagecolormatch/cve_2019_6977 \
+	gdimagecolormatch/gdimagecolormatch
+
+EXTRA_DIST += \
+	gdimagecolormatch/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/cve_2019_6977.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/cve_2019_6977.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/cve_2019_6977.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,25 @@
+/**
+ * Test for CVE-2019-6977
+ */
+
+#include "gd.h"
+
+int main()
+{
+	gdImagePtr im1;
+	gdImagePtr im2;
+
+	im1 = gdImageCreateTrueColor(0xfff, 0xfff);
+	im2 = gdImageCreate(0xfff, 0xfff);
+	if (gdImageColorAllocate(im2, 0, 0, 0) < 0)
+	{
+		gdImageDestroy(im1);
+		gdImageDestroy(im2);
+		return 1;
+	}
+	gdImageSetPixel(im2, 0, 0, 255);
+	gdImageColorMatch(im1, im2);
+	gdImageDestroy(im1);
+	gdImageDestroy(im2);
+	return 0;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/cve_2019_6977.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/gdimagecolormatch.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/gdimagecolormatch.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/gdimagecolormatch.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,32 @@
+/**
+ * Basic test for gdImageColorMatch()
+ **/
+#include "gd.h"
+#include "gdtest.h"
+
+int main(){
+	gdImagePtr im1, im2;
+
+	im1 = gdImageCreateTrueColor(80, 80);
+	im2 = gdImageCreate(80, 80);
+
+	gdImageColorAllocate(im1, 255, 36, 74);
+
+	gdImageColorAllocate(im2, 255, 36, 74);
+	gdImageColorAllocate(im2, 40, 0, 240);
+	gdImageColorAllocate(im2, 255, 100, 255);
+	gdImageColorAllocate(im2, 80, 60, 44);
+
+	int ifMatch = gdImageColorMatch(im1, im2);
+
+	gdImageDestroy(im1);
+	gdImageDestroy(im2);
+
+	if (gdTestAssert(ifMatch != 0))
+	{
+		gdTestErrorMsg("gdImageColorMatch failed.\n");
+		return 1;
+	}
+
+	return 0;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolormatch/gdimagecolormatch.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	gdimagecolorreplace
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagecolorreplace/gdimagecolorreplace
-endif
 
 EXTRA_DIST += \
 	gdimagecolorreplace/CMakeLists.txt

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/gdimagecolorreplace.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/gdimagecolorreplace.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorreplace/gdimagecolorreplace.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -44,22 +44,22 @@
 	COLOR(yellow, 0xFF, 0xFF, 0);
 #undef COLOR
 
-#define CHECK_VALUE(n, expected) do {							\
-		if (gdTestAssert((n) == (expected)) != 1) {				\
+#define CHECK_VALUE(n, expected) do {								\
+		if (gdTestAssert((n) == (expected)) != 1) {					\
 			gdTestErrorMsg("%d is expected, but %d\n", expected, n);\
-			*error = -1;										\
-		}														\
+			*error = -1;											\
+		}															\
 	} while (0)
 
 #define CHECK_PIXEL(x, y, expected) \
-	do {														\
-		int pix;												\
-		gdImageSetClip(im, 0, 0, 4, 4);							\
-		pix = gdImageGetPixel(im, (x), (y));					\
-		if (gdTestAssert(pix == (expected)) != 1) {				\
+	do {																\
+		int pix;														\
+		gdImageSetClip(im, 0, 0, 4, 4);									\
+		pix = gdImageGetPixel(im, (x), (y));							\
+		if (gdTestAssert(pix == (expected)) != 1) {						\
 			gdTestErrorMsg("%d is expected, but %d\n", expected, pix);	\
-			*error = -1;										\
-		}														\
+			*error = -1;												\
+		}																\
 	} while (0)
 
 	c = gdImageColorAllocate(im, 0xFF, 0, 0xFF);

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	gdimagecolorresolve
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecolorresolve/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,5 @@
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagecolorresolve/gdimagecolorresolve
-endif
 
 EXTRA_DIST += \
 	gdimagecolorresolve/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,4 @@
+LIST(APPEND TESTS_FILES
+	gdimagecompare
+)
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,5 @@
+libgd_test_programs += \
+	gdimagecompare/gdimagecompare
+
+EXTRA_DIST += \
+	gdimagecompare/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/gdimagecompare.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/gdimagecompare.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/gdimagecompare.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,56 @@
+/**
+ * Base test for gdImageCompare()
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im1;
+	gdImagePtr im2;
+	int black;
+	int red1, red2;
+	int yellow1, yellow2;
+	int white;
+	int blue;
+	int ret;
+
+	im1 = gdImageCreate(128, 128);
+	im2 = gdImageCreateTrueColor(256, 256);
+
+	/* Set different interlace */
+	gdImageInterlace(im1, 1);
+	gdImageInterlace(im2, 2);
+
+	/* Set different transparent */
+	gdImageColorTransparent(im1, 10);
+	gdImageColorTransparent(im2, 20);
+
+	/* Allocate different color number */
+	black = gdImageColorAllocate(im1, 0, 0, 0);
+	red1 = gdImageColorAllocate(im1, 255, 0, 0);
+	yellow1 = gdImageColorAllocate(im1, 255, 255, 0);
+	red2 = gdImageColorAllocate(im2, 255, 0, 0);
+	yellow2 = gdImageColorAllocate(im2, 255, 255, 0);
+	white = gdImageColorAllocate(im2, 255, 255, 255);
+	blue = gdImageColorAllocate(im2, 0, 0, 255);
+
+	/* Filled different color */
+	gdImageFilledRectangle(im1, 0, 0, 127, 8, black);
+	gdImageFilledRectangle(im1, 9, 0, 127, 16, red1);
+	gdImageFilledRectangle(im1, 17, 0, 127, 24, yellow1);
+	gdImageFilledRectangle(im2, 0, 0, 127, 8, red2);
+	gdImageFilledRectangle(im2, 9, 0, 127, 16, yellow2);
+	gdImageFilledRectangle(im2, 17, 0, 127, 24, white);
+	gdImageFilledRectangle(im2, 25, 0, 127, 32, blue);
+
+	ret = gdImageCompare(im1, im2);
+
+	gdTestAssert(ret == (GD_CMP_INTERLACE | GD_CMP_TRANSPARENT | GD_CMP_TRUECOLOR | GD_CMP_SIZE_X | GD_CMP_SIZE_Y | GD_CMP_COLOR | GD_CMP_IMAGE | GD_CMP_NUM_COLORS));
+
+	gdImageDestroy(im1);
+	gdImageDestroy(im2);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecompare/gdimagecompare.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecontrast/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecontrast/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecontrast/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,40 +2,36 @@
  * Basic test for gdImageContrast()
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 static void test_contrast(double contrast);
 
-
 int main()
 {
-    test_contrast(+50.0);
-    test_contrast(-50.0);
+	test_contrast(+50.0);
+	test_contrast(-50.0);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }
 
-
 static void test_contrast(double contrast)
 {
-    gdImagePtr im;
-    FILE *fp;
-    char basename[256];
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char basename[256];
+	char *path;
 
-    fp = gdTestFileOpen2("gdimagecontrast", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimagecontrast", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    gdImageContrast(im, contrast);
+	gdImageContrast(im, contrast);
 
-    sprintf(basename, "basic%+03.0f.png", contrast);
-    path = gdTestFilePath2("gdimagecontrast", basename);
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	sprintf(basename, "basic%+03.0f.png", contrast);
+	path = gdTestFilePath2("gdimagecontrast", basename);
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,3 +1,5 @@
+LIST(APPEND TESTS_FILES bug00369)
+
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	basic

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,3 +1,6 @@
+libgd_test_programs += \
+	gdimageconvolution/bug00369
+
 if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimageconvolution/basic

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,61 +2,54 @@
  * Basic test for gdImageConvolution() and related functions
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 static void test_convolution(void (*convolution_func)(gdImagePtr im), const char *expected)
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("gdimageconvolution", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimageconvolution", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    convolution_func(im);
+	convolution_func(im);
 
-    path = gdTestFilePath2("gdimageconvolution", expected);
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimageconvolution", expected);
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 }
 
-
 static void test_edge_detect_quick(gdImagePtr im)
 {
-    gdImageEdgeDetectQuick(im);
+	gdImageEdgeDetectQuick(im);
 }
 
-
 static void test_smooth(gdImagePtr im)
 {
-    gdImageSmooth(im, 5);
+	gdImageSmooth(im, 5);
 }
 
-
 static void test_emboss(gdImagePtr im)
 {
-    gdImageEmboss(im);
+	gdImageEmboss(im);
 }
 
-
 static void test_mean_removal(gdImagePtr im)
 {
-    gdImageMeanRemoval(im);
+	gdImageMeanRemoval(im);
 }
 
-
 int main()
 {
-    test_convolution(&test_edge_detect_quick, "basic_edge_detect_quick.png");
-    test_convolution(&test_smooth, "basic_smooth.png");
-    test_convolution(&test_emboss, "basic_emboss.png");
-    test_convolution(&test_mean_removal, "basic_mean_removal.png");
+	test_convolution(&test_edge_detect_quick, "basic_edge_detect_quick.png");
+	test_convolution(&test_smooth, "basic_smooth.png");
+	test_convolution(&test_emboss, "basic_emboss.png");
+	test_convolution(&test_mean_removal, "basic_mean_removal.png");
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/bug00369.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/bug00369.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/bug00369.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,28 @@
+/**
+ * Test Issue #369 for gdImageConvolution()
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	float matrix[3][3] = {
+		{1, 0, 1},
+		{0, 5, 0},
+		{1, 0, 0}
+	};
+
+	im = gdImageCreateTrueColor(40, 40);
+	gdImageAlphaBlending(im, gdEffectReplace);
+	gdImageFilledRectangle(im, 0, 0, 39, 39, 0x7FFFFFFF);
+	gdImageFilledEllipse(im, 19, 19, 20, 20, 0x00FF00);
+
+	gdImageConvolution(im, matrix, 9, 1);
+	gdTestAssert(0x7F010101 == gdImageGetPixel(im, 0, 0));
+
+	gdImageDestroy(im);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageconvolution/bug00369.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagecopymerge
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagecopymerge/gdimagecopymerge
+endif
+
+EXTRA_DIST += \
+	gdimagecopymerge/CMakeLists.txt \
+	gdimagecopymerge/gdimagecopymerge_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,38 @@
+/**
+ * Basic test for gdImageCopyMerge()
+ */
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr dst = NULL;
+	gdImagePtr src = NULL;
+	int error = 0;
+
+	dst = gdImageCreate(100, 100);
+	src = gdImageCreate(50, 50);
+
+	if (gdTestAssert(!dst)) {
+		error = 1;
+		goto done;
+	}
+	if (gdTestAssert(!src)) {
+		error = 1;
+		goto done;
+	}
+
+	gdImageColorAllocate(src, 255, 255, 255);
+	gdImageColorAllocate(dst, 0, 0, 0);
+	gdImageCopyMerge(dst, src, 25, 25, 0, 0, 50, 50, 50);
+
+	if (!gdAssertImageEqualsToFile("gdimagecopymerge/gdimagecopymerge_exp.png", dst)) {
+		error = 1;
+	}
+
+done:
+	gdImageDestroy(dst);
+	gdImageDestroy(src);
+
+	return error;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymerge/gdimagecopymerge_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagecopymergegray
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagecopymergegray/gdimagecopymergegray
+endif
+
+EXTRA_DIST += \
+	gdimagecopymergegray/CMakeLists.txt \
+	gdimagecopymergegray/gdimagecopymergegray_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,38 @@
+/**
+ * Basic test for gdImageCopyMergeGray()
+ */
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr dst = NULL;
+	gdImagePtr src = NULL;
+	int error = 0;
+
+	dst = gdImageCreate(100, 100);
+	src = gdImageCreate(50, 50);
+
+	if (gdTestAssert(!dst)) {
+		error = 1;
+		goto done;
+	}
+	if (gdTestAssert(!src)) {
+		error = 1;
+		goto done;
+	}
+
+	gdImageColorAllocate(src, 255, 255, 255);
+	gdImageColorAllocate(dst, 0, 0, 0);
+	gdImageCopyMergeGray(dst, src, 25, 25, 0, 0, 50, 50, 50);
+
+	if (!gdAssertImageEqualsToFile("gdimagecopymergegray/gdimagecopymergegray_exp.png", dst)) {
+		error = 1;
+	}
+
+done:
+	gdImageDestroy(dst);
+	gdImageDestroy(src);
+
+	return error;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopymergegray/gdimagecopymergegray_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,8 +1,10 @@
+LIST(APPEND TESTS_FILES
+	exact_alpha
+)
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	basic
 	basic_alpha
-	exact_alpha
 	bug00201
 )
 ENDIF(PNG_FOUND)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,8 +1,10 @@
+libgd_test_programs += \
+	gdimagecopyresampled/exact_alpha
+
 if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagecopyresampled/basic \
 	gdimagecopyresampled/basic_alpha \
-	gdimagecopyresampled/exact_alpha \
 	gdimagecopyresampled/bug00201
 endif
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -48,23 +48,23 @@
     fp = gdTestFileOpen2("gdimagecopyresampled", "bug00201_src.png");
     logo_source = gdImageCreateFromPng(fp);
     fclose(fp);
-    
+
     logo = blank_image(SRC_WIDTH,SRC_HEIGHT);
     gdImageAlphaBlending(logo, 0);
     gdImageCopy(logo, logo_source, 0,0, 0,0, SRC_WIDTH,SRC_HEIGHT);
     gdImageDestroy(logo_source);
-    
+
     scaled_logo = blank_image(DEST_WIDTH,DEST_HEIGHT);
     gdImageAlphaBlending(scaled_logo, 0);
     gdImageCopyResampled(scaled_logo, logo, 0,0, 0,0, 200,105, SRC_WIDTH,SRC_HEIGHT);
     gdImageDestroy(logo);
-    
+
     layers[0] = background;
     layers[1] = scaled_logo;
     img = flatten(layers, 2, DEST_WIDTH, DEST_HEIGHT);
     gdImageDestroy(background);
     gdImageDestroy(scaled_logo);
-    
+
     gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
     gdImageDestroy(img);
     return gdNumFailures();

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagecopyresized
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagecopyresized/gdimagecopyresized
+endif
+
+EXTRA_DIST += \
+	gdimagecopyresized/CMakeLists.txt \
+	gdimagecopyresized/gdimagecopyresized_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,35 @@
+/**
+ * add test case for gdImageCopyResized
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr src;
+	gdImagePtr dst;
+	gdImagePtr dst_tc;
+
+	/* We prepare two image type: Palette and True Color */
+	/* src image is white, while dst and dst_tc is black */
+	src = gdImageCreate(64, 64);
+	gdImageColorAllocate(src, 255, 255, 255);
+	dst = gdImageCreate(128, 128);
+	gdImageColorAllocate(dst, 0, 0, 0);
+	dst_tc = gdImageCreateTrueColor(128, 128);
+
+	/* Copy src to two image type separately */
+	/* We copy src to the center of dst and dst_tc */
+	gdImageCopyResized(dst, src, 32, 32, 0, 0, 64, 64, 64, 64);
+	gdImageCopyResized(dst_tc, src, 32, 32, 0, 0, 64, 64, 64, 64);
+
+	gdAssertImageEqualsToFile("gdimagecopyresized/gdimagecopyresized_exp.png", dst);
+	gdAssertImageEqualsToFile("gdimagecopyresized/gdimagecopyresized_exp.png", dst_tc);
+
+	gdImageDestroy(src);
+	gdImageDestroy(dst);
+	gdImageDestroy(dst_tc);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecopyresized/gdimagecopyresized_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-SET(TESTS_FILES
+LIST(APPEND TESTS_FILES
 	bug00340
 )
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/bug00340.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/bug00340.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecreate/bug00340.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -5,29 +5,25 @@
  * triggering an appropriate warning.
  */
 
-
 #include <string.h>
 #include "gd.h"
 #include "gd_errors.h"
 #include "gdtest.h"
 
-
 #define MSG "product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n"
 
-
 void error_handler(int priority, const char *format, ...)
 {
-    gdTestAssert(priority == GD_WARNING);
-    gdTestAssert(!strcmp(format, MSG));
+	gdTestAssert(priority == GD_WARNING);
+	gdTestAssert(!strcmp(format, MSG));
 }
 
-
 int main()
 {
-    gdImagePtr im;
+	gdImagePtr im;
 
-    im = gdImageCreate(64970, 65111);
-    gdTestAssert(im == NULL);
+	im = gdImageCreate(64970, 65111);
+	gdTestAssert(im == NULL);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,10 @@
-SET(TESTS_FILES
+LIST(APPEND TESTS_FILES
 	bug00297
+	bug00432
+	bug00485_auto
+	bug00485_threshold
 	php_bug_72494
+	bug00486
 )
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,9 @@
 libgd_test_programs += \
 	gdimagecrop/bug00297 \
+	gdimagecrop/bug00432 \
+	gdimagecrop/bug00485_auto \
+	gdimagecrop/bug00485_threshold \
+	gdimagecrop/bug00486 \
 	gdimagecrop/php_bug_72494
 
 EXTRA_DIST += \

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00432.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00432.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00432.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,45 @@
+/**
+ * Test that gdImageCrop() retains transparency
+ *
+ * We create an image with transparent pixels, crop the image, and check whether
+ * all pixels are identical to the respective source image.
+ *
+ * See <https://github.com/libgd/libgd/issues/432>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+#define WIDTH 10
+#define HEIGHT 10
+#define XOFF 1
+#define YOFF 1
+
+
+int main()
+{
+    gdImagePtr src, dst;
+    gdRect crop = {XOFF, YOFF, WIDTH-XOFF-1, HEIGHT-YOFF-1};
+    int i, j;
+
+    src = gdImageCreateTrueColor(WIDTH, HEIGHT);
+    gdImageAlphaBlending(src, gdEffectReplace);
+    gdImageFilledRectangle(src, 0, 0, WIDTH-1, HEIGHT-1,
+            gdTrueColorAlpha(gdRedMax, gdGreenMax, gdBlueMax, gdAlphaMax));
+
+    dst = gdImageCrop(src, &crop);
+    gdTestAssert(dst != NULL);
+
+    for (i = 0; i < gdImageSX(dst); i++) {
+        for (j = 0; j < gdImageSY(dst); j++) {
+            gdTestAssert(gdImageGetPixel(dst, i, j) == gdImageGetPixel(src, i+XOFF, j+YOFF));
+        }
+    }
+
+    gdImageDestroy(src);
+    gdImageDestroy(dst);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00432.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_auto.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_auto.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_auto.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,52 @@
+/**
+ * Test that gdImageCropAuto() works pixel precise
+ *
+ * We test that a single black pixel anywhere (but the corners) on an 8x8 pixel
+ * image with a white background is auto-cropped to a 1x1 pixel image with a
+ * black pixel.
+ *
+ * See <https://github.com/libgd/libgd/issues/485>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+gdImagePtr createWhiteImageWithBlackPixelAt(int x, int y)
+{
+    gdImagePtr im = gdImageCreateTrueColor(8, 8);
+    gdImageFilledRectangle(im, 0, 0, 7, 7, 0xffffff);
+    gdImageSetPixel(im, x, y, 0x000000);
+    return im;
+}
+
+
+int main()
+{
+    int x, y, height, width, color;
+    gdImagePtr orig, cropped;
+
+    for (y = 0; y < 8; y++) {
+        for (x = 0; x < 8; x++) {
+            if ((x == 0 && (y == 0 || y == 7)) || (x == 7 && (y == 0 || y == 7))) {
+                continue; // skip the corners
+            }
+            orig = createWhiteImageWithBlackPixelAt(x, y);
+            cropped = gdImageCropAuto(orig, GD_CROP_SIDES);
+            gdTestAssertMsg(cropped != NULL, "Pixel at %d, %d: unexpected NULL crop\n", x, y);
+            if (cropped) {
+                width = gdImageSX(cropped);
+                gdTestAssertMsg(width == 1, "Pixel at %d, %d: unexpected width (%d)\n", x, y, width);
+                height = gdImageSY(cropped);
+                gdTestAssertMsg(height == 1, "Pixel at %d, %d: unexpected height (%d)\n", x, y, height);
+                color = gdImageGetPixel(cropped, 0, 0);
+                gdTestAssertMsg(color == 0x000000, "Pixel at %d, %d: unexpected color (%d)\n", x, y, color);
+                gdImageDestroy(cropped);
+            }
+            gdImageDestroy(orig);
+        }
+    }
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_auto.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_threshold.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_threshold.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_threshold.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,48 @@
+/**
+ * Test that gdImageCropThreshold() works pixel precise
+ *
+ * We test that a single black pixel anywhere on an 8x8 pixel image with a white
+ * background is threshold-cropped to a 1x1 pixel image with a black pixel.
+ *
+ * See <https://github.com/libgd/libgd/issues/485>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+gdImagePtr createWhiteImageWithBlackPixelAt(int x, int y)
+{
+    gdImagePtr im = gdImageCreateTrueColor(8, 8);
+    gdImageFilledRectangle(im, 0, 0, 7, 7, 0xffffff);
+    gdImageSetPixel(im, x, y, 0x000000);
+    return im;
+}
+
+
+int main()
+{
+    int x, y, height, width, color;
+    gdImagePtr orig, cropped;
+
+    for (y = 0; y < 8; y++) {
+        for (x = 0; x < 8; x++) {
+            orig = createWhiteImageWithBlackPixelAt(x, y);
+            cropped = gdImageCropThreshold(orig, 0xffffff, 1.0);
+            gdTestAssertMsg(cropped != NULL, "Pixel at %d, %d: unexpected NULL crop\n", x, y);
+            if (cropped) {
+                width = gdImageSX(cropped);
+                gdTestAssertMsg(width == 1, "Pixel at %d, %d: unexpected width (%d)\n", x, y, width);
+                height = gdImageSY(cropped);
+                gdTestAssertMsg(height == 1, "Pixel at %d, %d: unexpected height (%d)\n", x, y, height);
+                color = gdImageGetPixel(cropped, 0, 0);
+                gdTestAssertMsg(color == 0x000000, "Pixel at %d, %d: unexpected color (%d)\n", x, y, color);
+                gdImageDestroy(cropped);
+            }
+            gdImageDestroy(orig);
+        }
+    }
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00485_threshold.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00486.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00486.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00486.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,48 @@
+/**
+ * Test that gdImageCropAuto() crops left and right as well
+ *
+ * We test that an image with four unicolored quadrants, where either both left
+ * quadrants or both right quadrants have the same color, but the remaining
+ * quadrants have different colors, are treated identically by
+ * gdImageCropAuto(…, GD_CROP_SIDES).
+ *
+ * See <https://github.com/libgd/libgd/issues/486>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr orig, croppedLeft, croppedRight;
+    int red, green, blue;
+
+    orig = gdImageCreateTrueColor(8, 8);
+    red = gdImageColorAllocate(orig, 255, 0, 0);
+    green = gdImageColorAllocate(orig, 0, 255, 0);
+    blue = gdImageColorAllocate(orig, 0, 0, 255);
+
+    gdImageFilledRectangle(orig, 0, 0, 3, 3, green); // tl
+    gdImageFilledRectangle(orig, 4, 0, 7, 3, red);   // tr
+    gdImageFilledRectangle(orig, 0, 4, 3, 7, green); // bl
+    gdImageFilledRectangle(orig, 4, 4, 7, 7, blue);  // br
+    croppedLeft = gdImageCropAuto(orig, GD_CROP_SIDES);
+    gdTestAssert(croppedLeft != NULL);
+
+    gdImageFilledRectangle(orig, 0, 0, 3, 3, red);   // tl
+    gdImageFilledRectangle(orig, 4, 0, 7, 3, green); // tr
+    gdImageFilledRectangle(orig, 0, 4, 3, 7, blue);  // bl
+    gdImageFilledRectangle(orig, 4, 4, 7, 7, green); // br
+    croppedRight = gdImageCropAuto(orig, GD_CROP_SIDES);
+    gdTestAssert(croppedRight != NULL);
+
+    gdAssertImageEquals(croppedRight, croppedLeft);
+
+	gdImageDestroy(orig);
+	gdImageDestroy(croppedLeft);
+	gdImageDestroy(croppedRight);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagecrop/bug00486.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	bug00169
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimageellipse/bug00169
+endif
+
+EXTRA_DIST += \
+	gdimageellipse/CMakeLists.txt \
+	gdimageellipse/bug00169_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,22 @@
+/**
+ * add test case for gdImageEllipse
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	int white = 0;
+
+	im = gdImageCreateTrueColor(2200, 2200);
+	white = gdImageColorAllocate(im, 255, 255, 255);
+
+	gdImageEllipse(im, 1100, 1100, 2200, 2200, white);
+	gdAssertImageEqualsToFile("gdimageellipse/bug00169_exp.png", im);
+
+	gdImageDestroy(im);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageellipse/bug00169_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,9 +1,11 @@
 if HAVE_LIBTIFF
 if HAVE_LIBWEBP
+if ENABLE_GD_FORMATS
 libgd_test_programs += \
 	gdimagefile/gdnametest
 endif
 endif
+endif
 
 EXTRA_DIST += \
 	gdimagefile/CMakeLists.txt \

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/gdnametest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/gdnametest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefile/gdnametest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -11,149 +11,145 @@
 #define LY (HEIGHT/2)   // Line Y
 #define HT 2            // Half of line-thickness
 
-
-gdImagePtr mkwhite(int x, int y)
+static gdImagePtr
+mkwhite(int x, int y)
 {
-    gdImagePtr im;
+	gdImagePtr im;
 
 	im = gdImageCreateTrueColor(x, y);
 	gdImageFilledRectangle(im, 0, 0, x-1, y-1,
-                           gdImageColorExactAlpha(im, 255, 255, 255, 0));
+	                       gdImageColorExactAlpha(im, 255, 255, 255, 0));
 
-    gdTestAssert(im != NULL);
+	gdTestAssert(im != NULL);
 
-    gdImageSetInterpolationMethod(im, GD_BICUBIC);    // FP interp'n
+	gdImageSetInterpolationMethod(im, GD_BICUBIC);    // FP interp'n
 
-    return im;
+	return im;
 }/* mkwhite*/
 
+static gdImagePtr
+mkcross(void)
+{
+	gdImagePtr im;
+	int fg, n;
 
-gdImagePtr mkcross() {
-    gdImagePtr im;
-    int fg, n;
+	im = mkwhite(WIDTH, HEIGHT);
+	fg = gdImageColorAllocate(im, 0, 0, 0);
 
-    im = mkwhite(WIDTH, HEIGHT);
-    fg = gdImageColorAllocate(im, 0, 0, 0);
+	for (n = -HT; n < HT; n++) {
+		gdImageLine(im, LX-n, 0, LX-n, HEIGHT-1, fg);
+		gdImageLine(im, 0, LY-n, WIDTH-1, LY-n, fg);
+	}/* for */
 
-    for (n = -HT; n < HT; n++) {
-        gdImageLine(im, LX-n, 0, LX-n, HEIGHT-1, fg);
-        gdImageLine(im, 0, LY-n, WIDTH-1, LY-n, fg);
-    }/* for */
-
-    return im;
+	return im;
 }/* mkcross*/
 
+static void
+do_test(void)
+{
+	gdTestAssertMsg(strchr("123",'2') != 0, "strchr() is not functional.\n");
+	gdTestAssertMsg(strcasecmp("123abC","123Abc") == 0, "strcasecmp() is not functional.\n");
 
+	int n;
+	struct {
+		const char *nm;     // Filename
+		unsigned maxdiff;   // Maximum total pixel diff
+		int required;       // 1 -> image type always supported, -1 -> skip it
+		int readonly;       // 1 -> gd can only read this type
+	} names[] = {
+		{"img.png",     0,  0,  0},
+		{"img.gif",     5,  1,  0},     // This seems to come from tc<->palette
+		{"img.GIF",     5,  1,  0},     // Test for case insensitivity
+		{"img.gd",      0,  1,  0},
+		{"img.gd2",     0,  0,  0},
+		{"img.jpg",    25,  0,  0},
+		{"img.jpeg",   25,  0,  0},
+		{"img.wbmp",    0,  1,  0},
+		{"img.bmp",     0,  1,  0},
+		{"img-ref.xpm", 0,  0,  1},
+		{"img-ref.xbm", 0,  1,  1},
+		{"img-ref.tga", 0,  1,  1},
+		{"img.webp",   10,  1,  0},
+		{"img.tiff",    0,  1,  0},
 
+		{NULL, 0}
+	};
 
-void
-do_test() {
+	for (n = 0; names[n].nm; n++) {
+		gdImagePtr orig, copy;
+		int status;
+		char *full_filename = NULL;
+		unsigned int pixels;
 
-    gdTestAssertMsg(strchr("123",'2') != 0, "strchr() is not functional.\n");
-    gdTestAssertMsg(strcasecmp("123abC","123Abc") == 0, "strcasecmp() is not functional.\n");
-    
-    int n;
-    struct {
-        const char *nm;     // Filename
-        unsigned maxdiff;   // Maximum total pixel diff
-        int required;       // 1 -> image type always supported, -1 -> skip it
-        int readonly;       // 1 -> gd can only read this type
-    } names[] = {
-        {"img.png",     0,  0,  0},
-        {"img.gif",     5,  1,  0},     // This seems to come from tc<->palette
-        {"img.GIF",     5,  1,  0},     // Test for case insensitivity
-        {"img.gd",      0,  1,  0}, 
-        {"img.gd2",     0,  0,  0}, 
-        {"img.jpg",    25,  0,  0},
-        {"img.jpeg",   25,  0,  0},
-        {"img.wbmp",    0,  1,  0},
-        {"img.bmp",     0,  1,  0},
-        {"img-ref.xpm", 0,  0,  1},
-        {"img-ref.xbm", 0,  1,  1},
-        {"img-ref.tga", 0,  1,  1},
-        {"img.webp",   10,  1,  0},
-        {"img.tiff",    0,  1,  0},
+		/* Some image readers are buggy and crash the program so we
+		 * skip them.  Bug fixers should remove these from the list of
+		 * skipped items as bugs are fixed. */
+		if (names[n].required < 0) {
+			printf("Skipping test for '%s'.  FIX THIS!\n", names[n].nm);
+			continue;
+		}/* if */
 
-        {NULL, 0}
-    };
+		/* Skip this file if the current library build doesn't support
+		 * it.  (If it's one of the built-in types, *that* a different
+		 * problem; we assert that here.) */
+		if (!gdSupportsFileType(names[n].nm, 0)) {
+			gdTestAssertMsg(!names[n].required, "GD doesn't support required file type: %s\n", names[n].nm);
+			continue;
+		}/* if */
 
-    for (n = 0; names[n].nm; n++) {
-        gdImagePtr orig, copy;
-        int status;
-        char *full_filename = NULL;
-        unsigned int pixels;
+		orig = mkcross();
 
-        /* Some image readers are buggy and crash the program so we
-         * skip them.  Bug fixers should remove these from the list of
-         * skipped items as bugs are fixed. */
-        if (names[n].required < 0) {
-            printf("Skipping test for '%s'.  FIX THIS!\n", names[n].nm);
-            continue;
-        }/* if */
+		/* Write the image unless writing is not supported. */
+		if (!names[n].readonly) {
+			/* Prepend the test directory; this is expected to be run in
+			 * the parent dir. */
+			full_filename = gdTestTempFile(names[n].nm);
+			status = gdImageFile(orig, full_filename);
+			gdTestAssertMsg(status == GD_TRUE, "Failed to create %s\n", full_filename);
+		} else {
+			/* Prepend the test directory; this is expected to be run in
+			 * the parent dir. */
+			full_filename = gdTestFilePath2("gdimagefile", names[n].nm);
+		}/* if */
 
-        /* Skip this file if the current library build doesn't support
-         * it.  (If it's one of the built-in types, *that* a different
-         * problem; we assert that here.) */
-        if (!gdSupportsFileType(names[n].nm, 0)) {
-            gdTestAssertMsg(!names[n].required, "GD doesn't support required file type: %s\n", names[n].nm);
-            continue;
-        }/* if */
+		copy = gdImageCreateFromFile(full_filename);
+		gdTestAssertMsg(!!copy, "Failed to load %s\n", full_filename);
+		if (!copy) continue;
 
-        orig = mkcross();
+		pixels = gdMaxPixelDiff(orig, copy);
+		gdTestAssertMsg(pixels <= names[n].maxdiff, "%u pixels different on %s\n", pixels, full_filename);
 
-        /* Write the image unless writing is not supported. */
-        if (!names[n].readonly) {
-            /* Prepend the test directory; this is expected to be run in
-             * the parent dir. */
-            full_filename = gdTestTempFile(names[n].nm);
-            status = gdImageFile(orig, full_filename);
-            gdTestAssertMsg(status == GD_TRUE, "Failed to create %s\n", full_filename);
-        } else {
-            /* Prepend the test directory; this is expected to be run in
-             * the parent dir. */
-            full_filename = gdTestFilePath2("gdimagefile", names[n].nm);
-        }/* if */
+		if (!names[n].readonly) {
+			status = remove(full_filename);
+			gdTestAssertMsg(status == 0, "Failed to delete %s\n", full_filename);
+		}/* if */
 
-        copy = gdImageCreateFromFile(full_filename);
-        gdTestAssertMsg(!!copy, "Failed to load %s\n", full_filename);
-        if (!copy) continue;
+		free(full_filename);
+		gdImageDestroy(orig);
+		gdImageDestroy(copy);
+	}/* for */
 
-        pixels = gdMaxPixelDiff(orig, copy);
-        gdTestAssertMsg(pixels <= names[n].maxdiff, "%u pixels different on %s\n", pixels, full_filename);
-
-        if (!names[n].readonly) {
-            status = remove(full_filename);
-            gdTestAssertMsg(status == 0, "Failed to delete %s\n", full_filename);
-        }/* if */
-
-        free(full_filename);
-        gdImageDestroy(orig);
-        gdImageDestroy(copy);
-    }/* for */
-
 }/* do_test*/
 
+static void
+do_errortest(void)
+{
+	gdImagePtr im;
 
-void
-do_errortest() {
-    gdImagePtr im;
+	im = mkcross();
 
-    im = mkcross();
+	gdTestAssert(!gdImageFile(im, "img.xpng"));
+	gdTestAssert(!gdImageFile(im, "bobo"));
+	gdTestAssert(!gdImageFile(im, "png"));
+	gdTestAssert(!gdImageFile(im, ""));
 
-    gdTestAssert(!gdImageFile(im, "img.xpng"));
-    gdTestAssert(!gdImageFile(im, "bobo"));
-    gdTestAssert(!gdImageFile(im, "png"));
-    gdTestAssert(!gdImageFile(im, ""));
-
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 }/* do_errortest*/
 
-
 int main()
 {
+	do_test();
+	do_errortest();
 
-    do_test();
-    do_errortest();
-
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_1.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_1.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_1.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -37,4 +37,3 @@
 
 	return error;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_2.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_2.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_2.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -46,4 +46,3 @@
 	gdImageDestroy(tile);
 	return error;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_3.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_3.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00002_3.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -51,4 +51,3 @@
 	gdImageDestroy(tile);
 	return error;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00104_1.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00104_1.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefill/bug00104_1.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,19 +8,19 @@
 	gdImagePtr im, tile;
 	int tile_red, tile_blue;
 	int error = 0;
-	
+
 	im = gdImageCreate(200, 150);
 
 	tile = gdImageCreateTrueColor(2, 2);
-	
+
 	tile_red = gdImageColorAllocate(tile, 255, 0, 0);
 	tile_blue = gdImageColorAllocate(tile, 0, 0, 255);
-	
+
 	gdImageSetPixel(tile, 0, 0, tile_red);
 	gdImageSetPixel(tile, 1, 1, tile_red);
 	gdImageSetPixel(tile, 1, 0, tile_blue);
 	gdImageSetPixel(tile, 0, 1, tile_blue);
-	
+
 	gdImageSetTile(im, tile);
 	gdImageFill(im, 11, 12, gdTiled);
 
@@ -27,7 +27,7 @@
 	if (!gdAssertImageEqualsToFile("gdimagefill/bug00104_1_exp.png", im)) {
 		error = 1;
 	}
-	
+
 	gdImageDestroy(im);
 	gdImageDestroy(tile);
 	return error;

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,6 @@
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
+	bug00351
 	php_bug43828
 )
 ENDIF(PNG_FOUND)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,8 +1,10 @@
 if HAVE_LIBPNG
 libgd_test_programs += \
+	gdimagefilledarc/bug00351 \
 	gdimagefilledarc/php_bug43828
 endif
 
 EXTRA_DIST += \
 	gdimagefilledarc/CMakeLists.txt \
+	gdimagefilledarc/bug00351_exp.png \
 	gdimagefilledarc/php_bug43828_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,30 @@
+/**
+ * Test drawing of pies starting and/or ending near 90°
+ *
+ * See <https://github.com/libgd/libgd/issues/351>.
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    int white, navy, red;
+
+    im = gdImageCreateTrueColor(500, 500);
+    white = gdTrueColorAlpha(0xFF, 0xFF, 0xFF, gdAlphaOpaque);
+    navy = gdTrueColorAlpha(0x00, 0x00, 0x80, gdAlphaOpaque);
+    red = gdTrueColorAlpha(0xFF, 0x00, 0x00, gdAlphaOpaque);
+
+    gdImageFilledArc(im, 250, 250, 500, 250, 0, 88, white, gdPie);
+    gdImageFilledArc(im, 250, 250, 500, 250, 88, 91 , navy, gdPie);
+    gdImageFilledArc(im, 250, 250, 500, 250, 91, 360 , red, gdPie);
+
+    gdAssertImageEqualsToFile("gdimagefilledarc/bug00351_exp.png", im);
+
+    gdImageDestroy(im);
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledarc/bug00351_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,7 @@
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	bug00010
+	bug00169
 	bug00191
 	github_bug_00238
 )

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,6 +1,7 @@
 if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagefilledellipse/bug00010 \
+	gdimagefilledellipse/bug00169 \
 	gdimagefilledellipse/bug00191 \
 	gdimagefilledellipse/github_bug_00238
 endif
@@ -8,5 +9,6 @@
 EXTRA_DIST += \
 	gdimagefilledellipse/CMakeLists.txt \
 	gdimagefilledellipse/bug00010_exp.png \
+	gdimagefilledellipse/bug00169_exp.png \
 	gdimagefilledellipse/bug00191.png \
 	gdimagefilledellipse/github_bug_00238_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,22 @@
+/**
+ * add test case for gdImageFilledEllipse
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	int white = 0;
+
+	im = gdImageCreateTrueColor(2200, 2200);
+	white = gdImageColorAllocate(im, 255, 255, 255);
+
+	gdImageFilledEllipse(im, 1100, 1100, 2200, 2200, white);
+	gdAssertImageEqualsToFile("gdimagefilledellipse/bug00169_exp.png", im);
+
+	gdImageDestroy(im);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/bug00169_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/github_bug_00238.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/github_bug_00238.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledellipse/github_bug_00238.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -12,7 +12,7 @@
 		goto exit;
 	}
 
-	gdImageAlphaBlending(im, gdEffectNormal);	
+	gdImageAlphaBlending(im, gdEffectNormal);
 	gdImageFilledRectangle(im, 0, 0, 140, 199, gdTrueColorAlpha(0,0,0,127));
 
 	gdImageAlphaBlending(im, gdEffectAlphaBlend);

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledpolygon/self_intersecting.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledpolygon/self_intersecting.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledpolygon/self_intersecting.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,29 +3,27 @@
  * *currently* using the even-odd fillrule.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    int black;
-    gdPoint points[] = {{50, 5}, {24, 86}, {93, 36}, {7, 36}, {76, 86}};
-    char *path;
+	gdImagePtr im;
+	int black;
+	gdPoint points[] = {{50, 5}, {24, 86}, {93, 36}, {7, 36}, {76, 86}};
+	char *path;
 
-    im = gdImageCreate(100, 100);
-    gdImageColorAllocate(im, 255, 255, 255);
-    black = gdImageColorAllocate(im, 0, 0, 0);
+	im = gdImageCreate(100, 100);
+	gdImageColorAllocate(im, 255, 255, 255);
+	black = gdImageColorAllocate(im, 0, 0, 0);
 
-    gdImageFilledPolygon(im, points, 5, black);
+	gdImageFilledPolygon(im, points, 5, black);
 
-    path = gdTestFilePath2("gdimagefilledpolygon", "self_intersecting_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimagefilledpolygon", "self_intersecting_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00004.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00004.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00004.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -24,4 +24,3 @@
 		return 1;
 	}
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00078.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00078.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00078.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -36,4 +36,3 @@
 	gdImageDestroy(im);
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -24,4 +24,3 @@
 		return 1;
 	}
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,8 +1,6 @@
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	bug00037
 	github_bug_215
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,8 +1,6 @@
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagefilltoborder/bug00037 \
 	gdimagefilltoborder/github_bug_215
-endif
 
 EXTRA_DIST += \
 	gdimagefilltoborder/CMakeLists.txt

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/bug00037.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/bug00037.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilltoborder/bug00037.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -27,4 +27,3 @@
 	}
 
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilter/gdCopyBlurred.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilter/gdCopyBlurred.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagefilter/gdCopyBlurred.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -143,7 +143,7 @@
 {
     gdImagePtr im = mkcross();
     gdImagePtr blurred;
-    const int RADIUS = 16; 
+    const int RADIUS = 16;
 
     gdTestAssert(!!im);
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageflip/gdimageflip.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageflip/gdimageflip.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageflip/gdimageflip.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,36 +2,33 @@
  * Testing the basic operation of the gdImageFlip*() functions
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 static void test_flip(void (BGD_STDCALL *func)(gdImagePtr), const char *filename)
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("gdimageflip", "remi.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimageflip", "remi.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    func(im);
+	func(im);
 
-    path = gdTestFilePath2("gdimageflip", filename);
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimageflip", filename);
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 }
 
-
 int main()
 {
-    test_flip(gdImageFlipVertical, "gdimageflipvertical_exp.png");
-    test_flip(gdImageFlipHorizontal, "gdimagefliphorizontal_exp.png");
-    test_flip(gdImageFlipBoth, "gdimageflipboth_exp.png");
+	test_flip(gdImageFlipVertical, "gdimageflipvertical_exp.png");
+	test_flip(gdImageFlipHorizontal, "gdimagefliphorizontal_exp.png");
+	test_flip(gdImageFlipBoth, "gdimageflipboth_exp.png");
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,28 +2,26 @@
  * Basic test for gdImageGrayScale()
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("gdimagegrayscale", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimagegrayscale", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    gdImageGrayScale(im);
+	gdImageGrayScale(im);
 
-    path = gdTestFilePath2("gdimagegrayscale", "basic_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimagegrayscale", "basic_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/bug00386.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/bug00386.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagegrayscale/bug00386.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -47,5 +47,7 @@
         }
     }
 
+    gdImageDestroy(im);
+
     return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,6 +7,7 @@
 	bug00077
 	bug00072
 	bug00111
+	bug00315
 	gdimageline_aa
 	gdimageline_bug5
 	gdImageAALine_thickness
@@ -14,4 +15,4 @@
 )
 ENDIF(PNG_FOUND)
 
-ADD_GD_TESTS(m)
+ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,6 +6,7 @@
 	gdimageline/bug00072 \
 	gdimageline/bug00077 \
 	gdimageline/bug00111 \
+	gdimageline/bug00315 \
 	gdimageline/gdimageline_aa \
 	gdimageline/gdimageline_bug5 \
 	gdimageline/gdImageAALine_thickness \
@@ -17,6 +18,7 @@
 	gdimageline/bug00072_exp.png \
 	gdimageline/bug00077_exp.png \
 	gdimageline/bug00111_exp.png \
+	gdimageline/bug00315_exp.png \
 	gdimageline/gdimageline_aa_a_1_exp.png \
 	gdimageline/gdimageline_aa_b_0_exp.png \
 	gdimageline/gdimageline_aa_c_0_exp.png \

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,37 @@
+/**
+ * Regression test for <https://github.com/libgd/libgd/issues/315>
+ *
+ * We're testing that a single-pointed gdImageAALine() is drawn as a single
+ * non-antialized pixel, according to (two-pointed) vertical and horizontal
+ * lines.
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	int white, black;
+	char *path;
+
+	im = gdImageCreateTrueColor(6, 6);
+	white = gdImageColorAllocate(im, 255, 255, 255);
+	black = gdImageColorAllocate(im, 0, 0, 0);
+	gdImageFilledRectangle(im, 0,0, 5,5, white);
+
+	gdImageLine(im, 4,4, 4,4, black);
+	gdImageLine(im, 1,4, 2,4, black);
+	gdImageLine(im, 4,1, 4,2, black);
+
+	gdImageSetAntiAliased(im, black);
+	gdImageLine(im, 1,1, 1,1, gdAntiAliased);
+
+	path = gdTestFilePath2("gdimageline", "bug00315_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
+
+	gdImageDestroy(im);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagenegate/basic.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagenegate/basic.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagenegate/basic.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,28 +2,26 @@
  * Basic test for gdImageNegate()
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("gdimagenegate", "basic.png");
-    im = gdImageCreateFromPng(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("gdimagenegate", "basic.png");
+	im = gdImageCreateFromPng(fp);
+	fclose(fp);
 
-    gdImageNegate(im);
+	gdImageNegate(im);
 
-    path = gdTestFilePath2("gdimagenegate", "basic_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimagenegate", "basic_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagepixelate/gdimagepixelate.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagepixelate/gdimagepixelate.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagepixelate/gdimagepixelate.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -27,28 +27,28 @@
 		}													\
 	} while (0)
 
-#define CHECK_PIXELS(im, expected) do {									\
-		int x, y;														\
-		for (y = 0; y < (im)->sy; y++) {								\
-			for (x = 0; x < (im)->sx; x++) {							\
-				int p = gdImageGetPixel(im, x, y);						\
-				int r = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>>16)&0xFF; \
-				int g = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>> 8)&0xFF; \
-				int b = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]    )&0xFF; \
-				if (r != gdImageRed(im, p)) {							\
+#define CHECK_PIXELS(im, expected) do {														  \
+		int x, y;																			  \
+		for (y = 0; y < (im)->sy; y++) {													  \
+			for (x = 0; x < (im)->sx; x++) {												  \
+				int p = gdImageGetPixel(im, x, y);											  \
+				int r = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>>16)&0xFF;					  \
+				int g = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>> 8)&0xFF;					  \
+				int b = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]    )&0xFF; 					  \
+				if (r != gdImageRed(im, p)) {												  \
 					gdTestErrorMsg("Red %x is expected, but %x\n", r, gdImageRed(im, p));	  \
-					return 0;											\
-				}														\
-				if (g != gdImageGreen(im, p)) {							\
+					return 0;																  \
+				}																			  \
+				if (g != gdImageGreen(im, p)) {												  \
 					gdTestErrorMsg("Green %x is expected, but %x\n", g, gdImageGreen(im, p)); \
-					return 0;											\
-				}														\
-				if (b != gdImageBlue(im, p)) {							\
+					return 0;																  \
+				}																			  \
+				if (b != gdImageBlue(im, p)) {												  \
 					gdTestErrorMsg("Blue %x is expected, but %x\n", b, gdImageBlue(im, p));	  \
-					return 0;											\
-				}														\
-			}															\
-		}																\
+					return 0;																  \
+				}																			  \
+			}																				  \
+		}																					  \
 	} while (0)
 
 static int testPixelate(gdImagePtr im)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/github_bug_00172.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/github_bug_00172.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/github_bug_00172.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -40,13 +40,6 @@
 			error |=1;
 		}
 	}
-
-	if (gdImageGetPixel(im, xs -1, 95) != white) {
-		error |=1;
-	}
-	if (gdImageGetPixel(im, xe +1, 95) != white) {
-		error |=1;
-	}
 	gdImageDestroy(im);
 
 	return error;

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/point_ordering.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/point_ordering.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagerectangle/point_ordering.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,7 @@
 /**
  * Test point ordering of gdImageRectangle()
  *
- * We're testing the two allowed point orders with and without thickness,
+ * We're testing all four possible point orders with and without thickness,
  * and verify that all sides of the rectangle are drawn.
  *
  * See also <https://github.com/libgd/libgd/issues/177>
@@ -27,10 +27,14 @@
     red   = gdImageColorAllocate(im, 255,   0,   0);
 
     draw_and_check_rectangle(im,  10,  10,  50,  50, black, red);
+    draw_and_check_rectangle(im,  50,  60,  10, 100, black, red);
     draw_and_check_rectangle(im,  50, 150,  10, 110, black, red);
+    draw_and_check_rectangle(im,  10, 200,  50, 160, black, red);
     gdImageSetThickness(im, 4);
     draw_and_check_rectangle(im,  60,  10, 100,  50, black, red);
+    draw_and_check_rectangle(im, 100,  60,  60, 100, black, red);
     draw_and_check_rectangle(im, 100, 150,  60, 110, black, red);
+    draw_and_check_rectangle(im,  60, 200, 100, 160, black, red);
 
 #if 0
     /* save image for debugging purposes */

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,11 +1,6 @@
 IF(PNG_FOUND)
-IF(JPEG_FOUND)
 LIST(APPEND TESTS_FILES
 	bug00067
-)
-ENDIF(JPEG_FOUND)
-
-LIST(APPEND TESTS_FILES
 	php_bug_64898
 	php_bug_65070
 )

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,10 +1,6 @@
 if HAVE_LIBPNG
-if HAVE_LIBJPEG
 libgd_test_programs += \
-	gdimagerotate/bug00067
-endif
-
-libgd_test_programs += \
+	gdimagerotate/bug00067 \
 	gdimagerotate/php_bug_64898 \
 	gdimagerotate/php_bug_65070
 endif

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -5,11 +5,9 @@
  * color.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
 	gdImagePtr src, dst;

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_65070_exp.png
===================================================================
(Binary files differ)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00329.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00329.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00329.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,48 +6,45 @@
  * expected color.
  */
 
-
 #include <string.h>
 #include "gd.h"
 #include "gdtest.h"
 
-
 static void test(const char *mode)
 {
-    gdImagePtr src, dst;
-    int expected, actual;
+	gdImagePtr src, dst;
+	int expected, actual;
 
-    if (strcmp(mode, "palette")) {
-        src = gdImageCreateTrueColor(100, 100);
-        expected = gdTrueColorAlpha(255, 255, 255, gdAlphaOpaque);
-        gdImageFilledRectangle(src, 0,0, 99,99, expected);
-    } else {
-        src = gdImageCreate(100, 100);
-        gdImageColorAllocate(src, 255, 255, 255);
-        expected = gdImageGetTrueColorPixel(src, 49, 49);
-    }
+	if (strcmp(mode, "palette")) {
+		src = gdImageCreateTrueColor(100, 100);
+		expected = gdTrueColorAlpha(255, 255, 255, gdAlphaOpaque);
+		gdImageFilledRectangle(src, 0,0, 99,99, expected);
+	} else {
+		src = gdImageCreate(100, 100);
+		gdImageColorAllocate(src, 255, 255, 255);
+		expected = gdImageGetTrueColorPixel(src, 49, 49);
+	}
 
-    gdImageSetInterpolationMethod(src, GD_BILINEAR_FIXED);
-    dst = gdImageScale(src, 200, 200);
+	gdImageSetInterpolationMethod(src, GD_BILINEAR_FIXED);
+	dst = gdImageScale(src, 200, 200);
 
-    actual = gdImageGetPixel(dst, 0, 0);
-    gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
-    actual = gdImageGetPixel(dst, 0, 199);
-    gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
-    actual = gdImageGetPixel(dst, 199, 199);
-    gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
-    actual = gdImageGetPixel(dst, 199, 0);
-    gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
+	actual = gdImageGetPixel(dst, 0, 0);
+	gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
+	actual = gdImageGetPixel(dst, 0, 199);
+	gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
+	actual = gdImageGetPixel(dst, 199, 199);
+	gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
+	actual = gdImageGetPixel(dst, 199, 0);
+	gdTestAssertMsg(actual == expected, "%s: wrong color; expected %x, but got %x", mode, expected, actual);
 
-    gdImageDestroy(src);
-    gdImageDestroy(dst);
+	gdImageDestroy(src);
+	gdImageDestroy(dst);
 }
 
-
 int main()
 {
-    test("palette");
-    test("truecolor");
+	test("palette");
+	test("truecolor");
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00330.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00330.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug00330.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -5,28 +5,26 @@
  * has the expected color value.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr src, dst;
-    int color;
+	gdImagePtr src, dst;
+	int color;
 
-    src = gdImageCreate(100, 100);
-    gdImageColorAllocate(src, 255, 255, 255);
+	src = gdImageCreate(100, 100);
+	gdImageColorAllocate(src, 255, 255, 255);
 
-    gdImageSetInterpolationMethod(src, GD_BILINEAR_FIXED);
-    dst = gdImageScale(src, 200, 200);
+	gdImageSetInterpolationMethod(src, GD_BILINEAR_FIXED);
+	dst = gdImageScale(src, 200, 200);
 
-    color = gdImageGetPixel(dst, 99, 99);
-    gdTestAssertMsg(color == 0xffffff,
-                    "expected color ffffff, but got %x\n", color);
+	color = gdImageGetPixel(dst, 99, 99);
+	gdTestAssertMsg(color == 0xffffff,
+	                "expected color ffffff, but got %x\n", color);
 
-    gdImageDestroy(src);
-    gdImageDestroy(dst);
+	gdImageDestroy(src);
+	gdImageDestroy(dst);
 
-    return 0;
+	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug_overflow_large_new_size.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug_overflow_large_new_size.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagescale/bug_overflow_large_new_size.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -15,7 +15,7 @@
 		return 1;
 	}
 	gdImageSetInterpolationMethod(im, GD_BELL);
-	
+
 	/* here the call may pass if the system has enough memory (physical or swap)
 	   or fails (overflow check or alloc fails.
 	   in both cases the tests pass */
@@ -22,6 +22,7 @@
 	im2 = gdImageScale(im,0x15555556, 1);
 	if (im2 == NULL) {
 		printf("gdImageScale failed, expected (out of memory or overflow validation\n");
+		gdImageDestroy(im);
 		return 0;
 	}
 	gdImageDestroy(im);

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,5 @@
+LIST(APPEND TESTS_FILES
+	github_bug_00584
+)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,5 @@
+libgd_test_programs += \
+	gdimagesetinterpolationmethod/github_bug_00584
+
+EXTRA_DIST += \
+	gdimagesetinterpolationmethod/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/github_bug_00584.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/github_bug_00584.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/github_bug_00584.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,31 @@
+/**
+ * Test that gdImageSetInterpolationMethod(im, GD_DEFAULT) is consistent
+ *
+ * See <https://github.com/libgd/libgd/issues/584>
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    gdInterpolationMethod old_m, new_m;
+    interpolation_method old_f, new_f;
+
+    im = gdImageCreateTrueColor(8, 8);
+    gdTestAssert(im != NULL);
+    gdTestAssert(gdImageSetInterpolationMethod(im, GD_SINC));
+    old_m = gdImageGetInterpolationMethod(im);
+    gdTestAssert(old_m == GD_SINC);
+    old_f = im->interpolation;
+    gdTestAssert(gdImageSetInterpolationMethod(im, GD_DEFAULT));
+    new_m = gdImageGetInterpolationMethod(im);
+    gdTestAssert(new_m == GD_LINEAR);
+    new_f = im->interpolation;
+    gdTestAssert(new_m != old_m);
+    gdTestAssert(new_f != old_f);
+    gdImageDestroy(im);
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetinterpolationmethod/github_bug_00584.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetpixel/alpha_blending.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetpixel/alpha_blending.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesetpixel/alpha_blending.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,53 +2,51 @@
  * Testing all effects
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    int effects[] = {
-        gdEffectReplace, gdEffectAlphaBlend, gdEffectNormal,
-        gdEffectOverlay, gdEffectMultiply
-    };
-    int red[3], blue[3];
-    int x, y, i, j;
-    char *path;
+	gdImagePtr im;
+	int effects[] = {
+		gdEffectReplace, gdEffectAlphaBlend, gdEffectNormal,
+		gdEffectOverlay, gdEffectMultiply
+	};
+	int red[3], blue[3];
+	int x, y, i, j;
+	char *path;
 
-    red[0] = gdTrueColorAlpha(0, 0, 255, 127);
-    red[1] = gdTrueColorAlpha(0, 0, 255, 63);
-    red[2] = gdTrueColorAlpha(0, 0, 255, 0);
-    blue[0] = gdTrueColorAlpha(255, 0, 0, 127);
-    blue[1] = gdTrueColorAlpha(255, 0, 0, 63);
-    blue[2] = gdTrueColorAlpha(255, 0, 0, 0);
+	red[0] = gdTrueColorAlpha(0, 0, 255, 127);
+	red[1] = gdTrueColorAlpha(0, 0, 255, 63);
+	red[2] = gdTrueColorAlpha(0, 0, 255, 0);
+	blue[0] = gdTrueColorAlpha(255, 0, 0, 127);
+	blue[1] = gdTrueColorAlpha(255, 0, 0, 63);
+	blue[2] = gdTrueColorAlpha(255, 0, 0, 0);
 
-    im = gdImageCreateTrueColor(120, 180);
+	im = gdImageCreateTrueColor(120, 180);
 
-    gdImageAlphaBlending(im, gdEffectReplace);
-    for (j = 0; j < 3; j++) {
-        y = 60 * j;
-        gdImageFilledRectangle(im, 0,y, 119,y+59, red[j]);
-    }
+	gdImageAlphaBlending(im, gdEffectReplace);
+	for (j = 0; j < 3; j++) {
+		y = 60 * j;
+		gdImageFilledRectangle(im, 0,y, 119,y+59, red[j]);
+	}
 
-    for (i = 0; i < 5; i++) {
-        x = 20 * i;
-        gdImageAlphaBlending(im, effects[i]);
-        for (j = 0; j < 9; j++) {
-            y = 20 * j;
-            gdImageFilledRectangle(im, x+20,y, x+39,y+19, blue[j % 3]);
-        }
-    }
+	for (i = 0; i < 5; i++) {
+		x = 20 * i;
+		gdImageAlphaBlending(im, effects[i]);
+		for (j = 0; j < 9; j++) {
+			y = 20 * j;
+			gdImageFilledRectangle(im, x+20,y, x+39,y+19, blue[j % 3]);
+		}
+	}
 
-    gdImageSaveAlpha(im, 1);
+	gdImageSaveAlpha(im, 1);
 
-    path = gdTestFilePath2("gdimagesetpixel", "alphablending_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("gdimagesetpixel", "alphablending_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagesquaretocircle
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,6 @@
+libgd_test_programs += \
+	gdimagesquaretocircle/gdimagesquaretocircle
+
+EXTRA_DIST += \
+	gdimagesquaretocircle/CMakeLists.txt \
+	gdimagesquaretocircle/gdimagesquaretocircle_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,32 @@
+/**
+ * Basic test for gdImageSquareToCircle()
+ */
+#include "gd.h"
+#include "gdfx.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im1, im2;
+	int white;
+	int black;
+
+	im1 = gdImageCreateTrueColor(128, 128);
+	white = gdImageColorAllocate(im1, 255, 255, 255);
+	black = gdImageColorAllocate(im1, 0, 0, 0);
+	gdImageFilledRectangle(im1, 0, 0, 127, 127, white);
+
+	/* Draw a cross line in the middle of im1 */
+	/* The horizonal line will become a circle in im2 */
+	/* The vertical line will become a horizonal with half len in im2 */
+	gdImageLine(im1, 0, 63, 127, 63, black);
+	gdImageLine(im1, 63, 0, 63, 127, black);
+	im2 = gdImageSquareToCircle(im1, 64);
+
+	gdAssertImageEqualsToFile("gdimagesquaretocircle/gdimagesquaretocircle_exp.png", im2);
+
+	gdImageDestroy(im1);
+	gdImageDestroy(im2);
+
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagesquaretocircle/gdimagesquaretocircle_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagestring
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagestring/gdimagestring
+endif
+
+EXTRA_DIST += \
+	gdimagestring/CMakeLists.txt \
+	gdimagestring/gdimagestring_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,34 @@
+/**
+ * Base test for gdImageString()
+ */
+#include <gd.h>
+#include <gdfontl.h>
+#include "gdtest.h"
+#include <string.h>
+
+int main()
+{
+	/* Declare the image */
+	gdImagePtr im = NULL;
+	char *s = "Hello gd";
+	int foreground = 0;
+	int error = 0;
+	gdFontPtr fontptr = gdFontGetLarge();
+
+	im = gdImageCreate(100, 50);
+	gdImageColorAllocate(im, 202, 202, 0);
+	foreground = gdImageColorAllocate(im, 22, 4, 238);
+
+	gdImageString(im, fontptr,
+			im->sx / 2 - (strlen(s) * fontptr->w / 2),
+			im->sy / 2 - fontptr->h / 2,
+			(unsigned char*)s, foreground);
+
+	if (!gdAssertImageEqualsToFile("gdimagestring/gdimagestring_exp.png", im))
+		error= 1;
+
+	/* Destroy the image in memory. */
+	gdImageDestroy(im);
+
+	return error;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring/gdimagestring_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagestring16
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagestring16/gdimagestring16
+endif
+
+EXTRA_DIST += \
+	gdimagestring16/CMakeLists.txt \
+	gdimagestring16/gdimagestring16_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,32 @@
+/**
+ * Base test for gdImageString16()
+ */
+#include <gd.h>
+#include <gdfontl.h>
+#include "gdtest.h"
+
+int main()
+{
+	/* Declare the image */
+	gdImagePtr im = NULL;
+	wchar_t *wchr = L"H";
+	unsigned short *sptr;
+	sptr = (unsigned short *)wchr;
+	int foreground;
+	int errorcode = 0;
+	gdFontPtr fontptr = gdFontGetLarge();
+
+	im = gdImageCreate(20, 20);
+	gdImageColorAllocate(im, 255, 255, 255);
+	foreground = gdImageColorAllocate(im, 22, 4, 238);
+
+	gdImageString16(im, fontptr, 2, 2, sptr, foreground);
+
+	if (!gdAssertImageEqualsToFile("gdimagestring16/gdimagestring16_exp.png", im))
+		errorcode = 1;
+
+	/* Destroy the image in memory */
+	gdImageDestroy(im);
+
+	return errorcode;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,9 +1,7 @@
 IF(FREETYPE_FOUND)
-IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	gdimagestringft_bbox
 )
-ENDIF(PNG_FOUND)
 ENDIF(FREETYPE_FOUND)
 
-ADD_GD_TESTS(m)
+ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,9 +1,7 @@
 if HAVE_LIBFREETYPE
-if HAVE_LIBPNG
 libgd_test_programs += \
 	gdimagestringft/gdimagestringft_bbox
 endif
-endif
 
 EXTRA_DIST += \
 	gdimagestringft/CMakeLists.txt

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/gdimagestringft_bbox.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/gdimagestringft_bbox.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringft/gdimagestringft_bbox.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,22 +8,22 @@
 #define DELTA (PI/8)
 
 static int EXPECT[16][8] = {
-	{498, 401, 630, 401, 630, 374, 498, 374},
-	{491, 364, 613, 313, 602, 288, 481, 338},
-	{470, 332, 563, 239, 544, 219, 451, 312},
-	{438, 310, 488, 189, 463, 178, 412, 300},
-	{401, 303, 401, 171, 374, 171, 374, 303},
-	{365, 310, 314, 188, 289, 199, 339, 320},
-	{334, 331, 241, 238, 221, 257, 314, 350},
-	{313, 362, 192, 312, 181, 337, 303, 388},
-	{306, 398, 174, 398, 174, 425, 306, 425},
-	{313, 433, 191, 484, 202, 509, 323, 459},
-	{333, 463, 240, 556, 259, 576, 352, 483},
-	{363, 484, 313, 605, 338, 616, 389, 494},
-	{398, 490, 398, 622, 425, 622, 425, 490},
-	{432, 483, 483, 605, 508, 594, 458, 473},
-	{461, 464, 554, 557, 574, 538, 481, 445},
-	{481, 435, 602, 485, 613, 460, 491, 409},
+	{500, 400, 628, 400, 628, 376, 500, 376},
+	{492, 362, 611, 312, 601, 290, 483, 339},
+	{470, 330, 561, 239, 544, 221, 453, 312},
+	{437, 308, 486, 189, 464, 180, 414, 299},
+	{400, 301, 400, 173, 376, 173, 376, 301},
+	{363, 309, 313, 190, 291, 200, 340, 318},
+	{332, 331, 241, 240, 223, 257, 314, 348},
+	{311, 363, 192, 314, 183, 336, 302, 386},
+	{304, 399, 176, 399, 176, 423, 304, 423},
+	{312, 435, 193, 485, 203, 507, 321, 458},
+	{333, 465, 242, 556, 259, 574, 350, 483},
+	{364, 486, 315, 605, 337, 614, 387, 495},
+	{399, 492, 399, 620, 423, 620, 423, 492},
+	{434, 484, 484, 603, 506, 593, 457, 475},
+	{463, 464, 554, 555, 572, 538, 481, 447},
+	{483, 434, 602, 483, 611, 461, 492, 411},
 };
 
 int main()

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagestringup
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagestringup/gdimagestringup
+endif
+
+EXTRA_DIST += \
+	gdimagestringup/CMakeLists.txt \
+	gdimagestringup/gdimagestringup_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,34 @@
+/**
+ * Base test for gdImageStringUp()
+ */
+#include <gd.h>
+#include <gdfontl.h>
+#include "gdtest.h"
+#include <string.h>
+
+int main()
+{
+	/* Declare the image */
+	gdImagePtr im = NULL;
+	char *s = "Hello gd";
+	int errorcode = 0;
+	int foreground;
+	gdFontPtr fontptr = gdFontGetLarge();
+
+	im = gdImageCreate(50, 100);
+	gdImageColorAllocate(im, 202, 202, 0);
+	foreground = gdImageColorAllocate(im, 22, 4, 238);
+
+	gdImageStringUp(im, fontptr,
+			im->sx / 2 - fontptr->h / 2,
+			im->sy / 2 + (strlen(s) * fontptr->w / 2),
+			(unsigned char*)s, foreground);
+
+	if (!gdAssertImageEqualsToFile("gdimagestringup/gdimagestringup_exp.png", im))
+		errorcode = 1;
+
+	/* Destroy the image im memory */
+	gdImageDestroy(im);
+
+	return errorcode;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup/gdimagestringup_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,7 @@
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+	gdimagestringup16
+)
+ENDIF(PNG_FOUND)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+	gdimagestringup16/gdimagestringup16
+endif
+
+EXTRA_DIST += \
+	gdimagestringup16/CMakeLists.txt \
+	gdimagestringup16/gdimagestringup16_exp.png

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,31 @@
+/**
+ * Base test for gdImageStringUp16()
+ */
+#include <gd.h>
+#include <gdfontl.h>
+#include "gdtest.h"
+
+int main()
+{
+	/* Declare the image */
+	gdImagePtr im = NULL;
+	wchar_t *wchr = L"H";
+	unsigned short *sptr;
+	sptr = (unsigned short *)wchr;
+	int foreground;
+	int errorcode = 0;
+	gdFontPtr fontptr = gdFontGetLarge();
+
+	im = gdImageCreate(20, 20);
+	gdImageColorAllocate(im, 255, 255, 255);
+	foreground = gdImageColorAllocate(im, 22, 4, 238);
+
+	gdImageStringUp16(im, fontptr, 2, 18, sptr, foreground);
+
+	if (!gdAssertImageEqualsToFile("gdimagestringup16/gdimagestringup16_exp.png", im))
+		errorcode = 1;
+
+	gdImageDestroy(im);
+
+	return errorcode;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdimagestringup16/gdimagestringup16_exp.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-SET(TESTS_FILES
+LIST(APPEND TESTS_FILES
 	bug00307
 	php_bug_72512
 )

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/bug00307.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/bug00307.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdimagetruecolortopalette/bug00307.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -5,7 +5,7 @@
  * GD_QUANT_NEUQUANT has its trueColor flag unset.
  */
 
- 
+
 #include "gd.h"
 #include "gdtest.h"
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdinterpolatedscale/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdinterpolatedscale/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdinterpolatedscale/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -4,3 +4,6 @@
 )
 
 ADD_GD_TESTS()
+
+# Probably should speed this test up.
+set_tests_properties(test_${TEST_PREFIX}_gdTrivialResize PROPERTIES TIMEOUT 20)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,6 @@
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
 #include <assert.h>
 #include <setjmp.h>
 #include <stdlib.h>
@@ -21,9 +23,16 @@
 #endif
 
 #ifdef _WIN32
-# include "readdir.h"
+#include "readdir.h"
+#include <errno.h>
 #endif
 
+/* GDTEST_TOP_DIR is defined in other compile ways except msys
+ * test_config.h is created by windows/msys/run_test.sh*/
+#ifndef GDTEST_TOP_DIR
+#include <test_config.h>
+#endif
+
 #include "gd.h"
 
 #include "gdtest.h"
@@ -40,7 +49,6 @@
 	(void)args;
 }
 
-#ifdef HAVE_LIBPNG
 gdImagePtr gdTestImageFromPng(const char *filename)
 {
 	gdImagePtr image;
@@ -58,7 +66,7 @@
 	}
 
 	if (fp == NULL) {
-			return NULL;
+		return NULL;
 	}
 
 	image = gdImageCreateFromPng(fp);
@@ -65,7 +73,6 @@
 	fclose(fp);
 	return image;
 }
-#endif
 
 static char *tmpdir_base;
 
@@ -188,11 +195,11 @@
 	fft.LowPart = ft.dwLowDateTime;
 	ff = fft.QuadPart;
 
-	ff /= 10Ui64; /* convert to microseconds */
-	ff -= 11644473600000000Ui64; /* convert to unix epoch */
+	ff /= 10ULL; /* convert to microseconds */
+	ff -= 11644473600000000ULL; /* convert to unix epoch */
 
-	tv->tv_sec = (long)(ff / 1000000Ui64);
-	tv->tv_usec = (long)(ff % 1000000Ui64);
+	tv->tv_sec = (long)(ff / 1000000ULL);
+	tv->tv_usec = (long)(ff % 1000000ULL);
 
 	return 0;
 }
@@ -205,7 +212,7 @@
 	static int counter = 0;
 	char *XXXXXX;
 	struct timeval tv;
-	_int64 value;
+	__int64 value;
 	int count;
 
 	/* find the last occurrence of "XXXXXX" */
@@ -221,7 +228,7 @@
 	value = (tv.tv_usec ^ tv.tv_sec) + counter++;
 
 	for (count = 0; count < 100; value += 7777, ++count) {
-		_int64 v = value;
+		__int64 v = value;
 
 		/* Fill in the random bits.  */
 		XXXXXX[0] = letters[v % NLETTERS];
@@ -306,7 +313,7 @@
 										  ret);
 				gdTestAssert(error != 0);
 		} else {
-			sprintf(ret, "%s\\%s", tempdir, template);		
+			sprintf(ret, "%s\\%s", tempdir, template);
 		}
 	}
 #else
@@ -363,6 +370,7 @@
 		strcat(file, "/");
 #endif
 		strcat(file, p);
+
 	} while ((p = va_arg(args, const char *)) != NULL);
 	va_end(args);
 
@@ -502,7 +510,6 @@
     return diff;
 }
 
-#ifdef HAVE_LIBPNG
 int gdTestImageCompareToImage(const char* file, unsigned int line, const char* message,
                               gdImagePtr expected, gdImagePtr actual)
 {
@@ -562,6 +569,7 @@
 		if (!fp) goto fail;
 		gdImagePng(surface_diff,fp);
 		fclose(fp);
+		gdImageDestroy(surface_diff);
 
 		fp = fopen(file_out, "wb");
 		if (!fp) goto fail;
@@ -581,9 +589,7 @@
 	}
 	return 1;
 }
-#endif
 
-#ifdef HAVE_LIBPNG
 int gdTestImageCompareToFile(const char* file, unsigned int line, const char* message,
                              const char *expected_file, gdImagePtr actual)
 {
@@ -601,7 +607,6 @@
 	}
 	return res;
 }
-#endif
 
 static int failureCount = 0;
 
@@ -622,9 +627,9 @@
 int _gdTestAssertMsg(const char* file, unsigned int line, int condition, const char* message, ...)
 {
 	va_list args;
-	
+
 	if (condition) return 1;
-  
+
 	fprintf(stderr, "%s:%u: ", file, line);
 	va_start(args, message);
 	vfprintf(stderr, message, args);

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.h
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.h	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtest/gdtest.h	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,7 +3,6 @@
 
 #include <stdarg.h>
 
-#define GDTEST_STRING_MAX 1024
 typedef struct CuTestImageResult CuTestImageResult;
 struct CuTestImageResult {
 	unsigned int pixels_changed;
@@ -64,10 +63,8 @@
 
 /* public assert functions */
 #define gdAssertImageEqualsToFile(ex,ac) gdTestImageCompareToFile(__FILE__,__LINE__,NULL,(ex),(ac))
-#define gdAssertImageFileEqualsMsg(ex,ac,ms) gdTestImageCompareFiles(__FILE__,__LINE__,(ms),(ex),(ac))
 
 #define gdAssertImageEquals(ex,ac) gdTestImageCompareToImage(__FILE__,__LINE__,NULL,(ex),(ac))
-#define gdAssertImageEqualsMsg(ex,ac,ms) gdTestImageCompareToImage(__FILE__,__LINE__,(ms),(ex),(ac))
 
 #define gdTestAssert(cond) _gdTestAssert(__FILE__, __LINE__, (cond))
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdtiled/bug00032.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtiled/bug00032.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtiled/bug00032.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -29,4 +29,3 @@
 	gdImageDestroy(tile);
 	return 0;
 }
-

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffineboundingbox/github_bug_00221.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffineboundingbox/github_bug_00221.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffineboundingbox/github_bug_00221.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -10,7 +10,7 @@
 		gdRect bbox;
 		gdRect area;
 		double affine[6];
-		
+
 		affine[0] = -0.965926;
 		affine[1] = -0.258819;
 		affine[2] =  0.258819;
@@ -24,7 +24,7 @@
 		if (gdTransformAffineBoundingBox(&area, affine, &bbox) != GD_TRUE) {
 			return 1;
 		}
-		if (!(bbox.x ==-253 &&  bbox.y ==-228 && bbox.width == 298 && bbox.height == 230)) {
+		if (!(bbox.x ==-253 &&  bbox.y ==-228 && bbox.width == 297 && bbox.height == 229)) {
 			return 1;
 		}
 

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/CMakeLists.txt	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+LIST(APPEND TESTS_FILES
+	github_bug_00583
+	github_bug_00585
+	github_bug_00586
+	github_bug_00596
+)
+
+ADD_GD_TESTS()


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/Makemodule.am	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,8 @@
+libgd_test_programs += \
+	gdtransformaffinecopy/github_bug_00583 \
+	gdtransformaffinecopy/github_bug_00585 \
+	gdtransformaffinecopy/github_bug_00586 \
+	gdtransformaffinecopy/github_bug_00596
+
+EXTRA_DIST += \
+	gdtransformaffinecopy/CMakeLists.txt

Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00583.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00583.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00583.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,30 @@
+/**
+ * Test that a zero determinant matrix causes gdTransformAffineCopy() to fail
+ *
+ * See <https://github.com/libgd/libgd/issues/583>
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr src, dst;
+    gdRect rect = {0, 0, 8, 8};
+    double matrix[] = {1, 1, 1, 1, 1, 1};
+    int white;
+    int res;
+
+    src = gdImageCreateTrueColor(8, 8);
+    gdTestAssert(src != NULL);
+    dst = gdImageCreateTrueColor(8, 8);
+    gdTestAssert(dst != NULL);
+    white = gdImageColorAllocate(src, 255, 255, 255);
+    gdImageFilledRectangle(src, 0, 0, 7, 7, white);
+    res = gdTransformAffineCopy(dst, 0, 0, src, &rect, matrix);
+    gdTestAssert(res == GD_FALSE);
+    gdImageDestroy(dst);
+    gdImageDestroy(src);
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00583.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00585.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00585.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00585.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,33 @@
+/*
+ * Test that gdTransformAffineCopy() does not change the interpolation method
+ *
+ * See <https://github.com/libgd/libgd/issues/585>
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr src, dst;
+	gdRect rect = {0, 0, 8, 8};
+	double matrix[] = {1, 1, 1, 1, 1, 1};
+	int res;
+	gdInterpolationMethod old_m, new_m;
+
+	src = gdImageCreateTrueColor(8, 8);
+	gdTestAssert(src != NULL);
+	dst = gdImageCreateTrueColor(8, 8);
+	gdTestAssert(dst != NULL);
+
+	res = gdImageSetInterpolationMethod(src, GD_CATMULLROM);
+	gdTestAssert(res == GD_TRUE);
+	old_m = gdImageGetInterpolationMethod(src);
+	gdTransformAffineCopy(dst, 0, 0, src, &rect, matrix);
+	new_m = gdImageGetInterpolationMethod(src);
+	gdTestAssert(new_m == old_m);
+
+	gdImageDestroy(src);
+	gdImageDestroy(dst);
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00585.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00586.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00586.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00586.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,26 @@
+/*
+ * Test that gdTransformAffineCopy() does not segfault for palette images
+ *
+ * See <>
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr src, dst;
+	gdRect rect = {0, 0, 8, 8};
+	double matrix[] = {1, 0, 0, 1, 0, 0};
+
+	src = gdImageCreate(8, 8);
+	gdTestAssert(src != NULL);
+	dst = gdImageCreate(8, 8);
+	gdTestAssert(dst != NULL);
+
+	gdTransformAffineCopy(dst, 0, 0, src, &rect, matrix);
+
+	gdImageDestroy(dst);
+	gdImageDestroy(src);
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00586.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00596.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00596.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00596.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,42 @@
+/**
+ * Test gdTransformAffineCopy() run error
+ *
+ * See <https://github.com/libgd/libgd/issues/596>
+ *
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	double matrix[] = {1, 0, 0, 1, 0, 0};
+	gdImagePtr src, dst;
+	gdRect rect = {0, 0, 16, 16};
+	int white, green;
+	int status = 0;
+	int res;
+	int actual_color = 0;
+	int expected_color = 0x00ff00;
+
+	src = gdImageCreateTrueColor(16, 16);
+	gdTestAssert(src != NULL);
+	white = gdImageColorAllocate(src, 255, 255, 255);
+	gdImageFilledRectangle(src, 0, 0, 16, 16, white);
+
+	dst = gdImageCreateTrueColor(50, 50);
+	gdTestAssert(dst != NULL);
+	green = gdImageColorAllocate(dst, 0, 255, 0);
+	gdImageFilledRectangle(dst, 0, 0, 50, 50, green);
+
+	res = gdTransformAffineCopy(dst, 4, 4, src, &rect, matrix);
+	gdTestAssert(res != GD_FALSE);
+
+	status = gdNumFailures();
+	actual_color = gdImageGetPixel(dst, 20, 5);
+	status = (actual_color == expected_color) ? status : 1;
+
+	gdImageDestroy(src);
+	gdImageDestroy(dst);
+	return status;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gdtransformaffinecopy/github_bug_00596.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/gif/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,17 +2,20 @@
 	bug00005_2
 	bug00181
 	bug00227
+	bug00499
 	gif_null
+	ossfuzz5700
+	php_bug_75571
+	uninitialized_memory_read
+	bug00006
+	bug00060
+	gif_im2im
 )
 
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	bug00005
-	bug00006
-	bug00060
 	bug00066
-	gif_im2im
-	uninitialized_memory_read
 )
 ENDIF(PNG_FOUND)
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gif/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,16 +2,19 @@
 	gif/bug00005_2 \
 	gif/bug00181 \
 	gif/bug00227 \
+	gif/bug00499 \
 	gif/gif_null \
-	gif/uninitialized_memory_read
+	gif/ossfuzz5700 \
+	gif/php_bug_75571 \
+	gif/uninitialized_memory_read \
+	gif/bug00006 \
+	gif/bug00060 \
+	gif/gif_im2im
 
 if HAVE_LIBPNG
 libgd_test_programs += \
 	gif/bug00005 \
-	gif/bug00006 \
-	gif/bug00060 \
-	gif/bug00066 \
-	gif/gif_im2im
+	gif/bug00066
 endif
 
 EXTRA_DIST += \
@@ -24,4 +27,6 @@
 	gif/bug00060.gif \
 	gif/bug00066.gif \
 	gif/bug00066_exp.png \
+	gif/ossfuzz5700.gif \
+	gif/php_bug_75571.gif \
 	gif/unitialized_memory_read.gif

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00006.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00006.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00006.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -64,5 +64,6 @@
 
 	/* Destroy it */
 	gdImageDestroy(im);
+	free(file);
 	return error;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00181.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00181.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00181.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -92,6 +92,7 @@
         }
 	error = !im->interlace;
 	gdImageDestroy(im);
+	free(file);
 
 	return error;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00227.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00227.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00227.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -65,5 +65,7 @@
 	if (buf[PROBE_SIZE-1] & 0x80) return 1;
 	free(buf);
 	fclose(fp);
+
+	free(file);
 	return 0;
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00499.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00499.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00499.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,51 @@
+/**
+ * Test that adding identical images to GIF animations do no double-free
+ *
+ * We are adding two frames to a GIF animation in gdDisposalNone mode, were the
+ * second frame is identical to the first, which result in that image to have
+ * zero extent.  This program must not cause any memory issues.
+ *
+ * See also <https://github.com/libgd/libgd/issues/499>.
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    int black;
+    int size;
+    void * res;
+
+    im = gdImageCreate(100, 100);
+    black = gdImageColorAllocate(im, 0, 0, 0);
+    gdImageRectangle(im, 0, 0, 10, 10, black);
+
+    res = gdImageGifAnimBeginPtr(im, &size, 1, 3);
+    if (res != NULL) {
+        gdFree(res);
+    }
+
+    res = gdImageGifAnimAddPtr(im, &size, 0, 0, 0, 100, gdDisposalNone, NULL);
+    if (res != NULL) {
+        gdFree(res);
+    }
+
+    res = gdImageGifAnimAddPtr(im, &size, 0, 0, 0, 100, gdDisposalNone, im);
+    gdTestAssert(res == NULL);
+    if (res != NULL) {
+         gdFree(res);
+    }
+
+    res = gdImageGifAnimEndPtr(&size);
+    if (res != NULL) {
+        gdFree(res);
+    }
+
+    gdImageDestroy(im);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gif/bug00499.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	FILE *fp = gdTestFileOpen("gif/ossfuzz5700.gif");
+	im = gdImageCreateFromGif(fp);
+	fclose(fp);
+	gdImageDestroy(im);
+	return 0;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gif/ossfuzz5700.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,28 @@
+/**
+ * Test that GIF reading does not loop infinitely
+ *
+ * We are reading a crafted GIF image which has been truncated.  This would
+ * trigger an infinite loop formerly, but know bails out early, returning
+ * NULL from gdImageCreateFromGif().
+ *
+ * See also https://bugs.php.net/bug.php?id=75571.
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr im;
+    FILE *fp;
+
+    fp = gdTestFileOpen2("gif", "php_bug_75571.gif");
+    gdTestAssert(fp != NULL);
+    im = gdImageCreateFromGif(fp);
+    gdTestAssert(im == NULL);
+    fclose(fp);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif
===================================================================
(Binary files differ)

Index: trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif	2020-04-10 03:40:48 UTC (rev 54636)

Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/gif/php_bug_75571.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/jpeg/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/jpeg/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/jpeg/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,7 +2,9 @@
 LIST(APPEND TESTS_FILES
 	jpeg_empty_file
 	jpeg_im2im
+	jpeg_ptr_double_free
 	jpeg_null
+	jpeg_resolution
 )
 
 IF(PNG_FOUND)
@@ -9,7 +11,6 @@
 LIST(APPEND TESTS_FILES
 	bug_github_18
 	jpeg_read
-	jpeg_resolution
 	bug00338
 )
 ENDIF(PNG_FOUND)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/jpeg/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/jpeg/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/jpeg/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,14 +2,15 @@
 libgd_test_programs += \
 	jpeg/jpeg_empty_file \
 	jpeg/jpeg_im2im \
-	jpeg/jpeg_null
+	jpeg/jpeg_null \
+	jpeg/jpeg_ptr_double_free \
+	jpeg/jpeg_resolution
 
 if HAVE_LIBPNG
 libgd_test_programs += \
 	jpeg/bug_github_18 \
 	jpeg/bug00338 \
-	jpeg/jpeg_read \
-	jpeg/jpeg_resolution
+	jpeg/jpeg_read
 endif
 endif
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,44 +8,39 @@
  * See also ../png/bug00338.c
  */
 
-
 #include <string.h>
 #include "gd.h"
 #include "gd_errors.h"
 #include "gdtest.h"
 
-
 #define MSG "gd-jpeg: JPEG library reports unrecoverable error: %s"
 
-
 static int error_handler_called = 0;
 
-
 static void error_handler(int priority, const char *format, va_list args)
 {
-    if (!strcmp(format, MSG)) {
-        gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority);
-        error_handler_called = 1;
-    }
+	if (!strcmp(format, MSG)) {
+		gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority);
+		error_handler_called = 1;
+	}
 }
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
+	gdImagePtr im;
+	FILE *fp;
 
-    gdSetErrorMethod(error_handler);
+	gdSetErrorMethod(error_handler);
 
-    im = gdImageCreateTrueColor(10, 10);
-    fp = gdTestTempFp();
-    gdImagePng(im, fp);
-    gdImageDestroy(im);
+	im = gdImageCreateTrueColor(10, 10);
+	fp = gdTestTempFp();
+	gdImagePng(im, fp);
+	gdImageDestroy(im);
 
-    im = gdImageCreateFromJpeg(fp);
-    gdTestAssert(im == NULL);
+	im = gdImageCreateFromJpeg(fp);
+	gdTestAssert(im == NULL);
 
-    gdTestAssert(error_handler_called);
+	gdTestAssert(error_handler_called);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Added: trunk/Build/source/libs/gd/libgd-src/tests/jpeg/jpeg_ptr_double_free.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/jpeg/jpeg_ptr_double_free.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/jpeg/jpeg_ptr_double_free.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,31 @@
+/**
+ * Test that failure to convert to JPEG returns NULL
+ *
+ * We are creating an image, set its width to zero, and pass this image to
+ * `gdImageJpegPtr()` which is supposed to fail, and as such should return NULL.
+ *
+ * See also <https://github.com/libgd/libgd/issues/381>
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+    gdImagePtr src, dst;
+    int size;
+
+    src = gdImageCreateTrueColor(1, 10);
+    gdTestAssert(src != NULL);
+
+    src->sx = 0; /* this hack forces gdImageJpegPtr() to fail */
+
+    dst = gdImageJpegPtr(src, &size, 0);
+    gdTestAssert(dst == NULL);
+
+    gdImageDestroy(src);
+
+    return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/jpeg/jpeg_ptr_double_free.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/png/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/png/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/png/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -10,8 +10,13 @@
 	bug00193
 	bug00338
 	bug00381_1
+)
+
+IF(ENABLE_GD_FORMATS)
+LIST(APPEND TESTS_FILES
 	bug00381_2
 )
+ENDIF(ENABLE_GD_FORMATS)
 ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/png/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/png/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/png/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,11 +7,15 @@
 	png/bug00193 \
 	png/bug00338 \
 	png/bug00381_1 \
-	png/bug00381_2 \
 	png/png_im2im \
 	png/png_null \
 	png/png_resolution
+
+if ENABLE_GD_FORMATS
+libgd_test_programs += \
+	png/bug00381_2
 endif
+endif
 
 EXTRA_DIST += \
 	png/CMakeLists.txt \

Modified: trunk/Build/source/libs/gd/libgd-src/tests/png/bug00338.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/png/bug00338.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/png/bug00338.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,41 +8,37 @@
  * See also ../jpeg/bug00338.c
  */
 
-
 #include <string.h>
 #include "gd.h"
 #include "gd_errors.h"
 #include "gdtest.h"
 
-
 #define MSG "gd-png: fatal libpng error: %s\n"
 
-
 static int error_handler_called = 0;
 
-
 static void error_handler(int priority, const char *format, va_list args)
 {
-    if (!strcmp(format, MSG)) {
-        gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority);
-        error_handler_called = 1;
-    }
+	if (!strcmp(format, MSG)) {
+		gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority);
+		error_handler_called = 1;
+	}
 }
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
+	gdImagePtr im;
+	FILE *fp;
 
-    gdSetErrorMethod(error_handler);
+	gdSetErrorMethod(error_handler);
 
-    im = gdImageCreateTrueColor(10, 10);
-    fp = gdTestTempFp();
-    gdImagePngEx(im, fp, 100);
-    gdImageDestroy(im);
+	im = gdImageCreateTrueColor(10, 10);
+	fp = gdTestTempFp();
+	gdImagePngEx(im, fp, 100);
+	gdImageDestroy(im);
+	fclose(fp);
 
-    gdTestAssert(error_handler_called);
+	gdTestAssert(error_handler_called);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/png/png_resolution.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/png/png_resolution.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/png/png_resolution.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -24,7 +24,7 @@
 		gdImageDestroy(im);
 		return 1;
 	}
-		
+
 	gdImageDestroy(im);
 	return 0;
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/tiff/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/tiff/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/tiff/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -4,8 +4,13 @@
 	tiff_invalid_read
 	tiff_null
 	tiff_dpi
+)
+
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
 	tiff_read_bw
 )
+ENDIF(PNG_FOUND)
 ENDIF(TIFF_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/tiff/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/tiff/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/tiff/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -3,9 +3,13 @@
 	tiff/tiff_dpi \
 	tiff/tiff_im2im \
 	tiff/tiff_invalid_read \
-	tiff/tiff_null \
+	tiff/tiff_null
+
+if HAVE_LIBPNG
+libgd_test_programs += \
 	tiff/tiff_read_bw
 endif
+endif
 
 EXTRA_DIST += \
 	tiff/CMakeLists.txt \

Modified: trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_dpi.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_dpi.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_dpi.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Test that reading and writing image resolution values to/from TIFF files
  * works correctly.  Set the image resolution, write the file, read the file
  * back and test that the image resolution comes back correct.
@@ -23,7 +23,7 @@
 	r = gdImageColorAllocate(src, 0xFF, 0, 0);
 	gdImageFilledRectangle(src, 0, 0, 99, 99, r);
 
-	// gd default DPI is 96; libtiff default is 72.  
+	// gd default DPI is 96; libtiff default is 72.
 	// Use something else so we know the value has been
 	// written / read correctly.
 	res_x = 100;

Modified: trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_read_bw.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_read_bw.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/tiff/tiff_read_bw.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,26 +1,25 @@
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("tiff", "tiff_read_bw.tiff");
-    gdTestAssert(fp != NULL);
-    im = gdImageCreateFromTiff(fp);
-    fclose(fp);
+	fp = gdTestFileOpen2("tiff", "tiff_read_bw.tiff");
+	gdTestAssert(fp != NULL);
+	im = gdImageCreateFromTiff(fp);
+	fclose(fp);
 
-    gdTestAssert(im != NULL);
-    gdTestAssert(!gdImageTrueColor(im));
+	gdTestAssert(im != NULL);
+	gdTestAssert(!gdImageTrueColor(im));
 
-    path = gdTestFilePath2("tiff", "tiff_read_bw_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("tiff", "tiff_read_bw_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/wbmp/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/wbmp/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/wbmp/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,11 +1,6 @@
 LIST(APPEND TESTS_FILES
 	wbmp_null
-)
-
-IF(PNG_FOUND)
-LIST(APPEND TESTS_FILES
 	wbmp_im2im
 )
-ENDIF(PNG_FOUND)
 
 ADD_GD_TESTS()

Modified: trunk/Build/source/libs/gd/libgd-src/tests/wbmp/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/wbmp/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/wbmp/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,10 +1,6 @@
 libgd_test_programs += \
-	wbmp/wbmp_null
-
-if HAVE_LIBPNG
-libgd_test_programs += \
+	wbmp/wbmp_null \
 	wbmp/wbmp_im2im
-endif
 
 EXTRA_DIST += \
 	wbmp/CMakeLists.txt

Modified: trunk/Build/source/libs/gd/libgd-src/tests/webp/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/webp/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/webp/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -2,6 +2,7 @@
 LIST(APPEND TESTS_FILES
 	bug00111
 	bug_double_free
+	gdImageWebpEx
 )
 ENDIF(WEBP_FOUND)
 

Modified: trunk/Build/source/libs/gd/libgd-src/tests/webp/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/webp/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/webp/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,8 @@
 if HAVE_LIBWEBP
 libgd_test_programs += \
 	webp/bug00111 \
-	webp/bug_double_free
+	webp/bug_double_free \
+	webp/gdImageWebpEx
 endif
 
 EXTRA_DIST += \

Added: trunk/Build/source/libs/gd/libgd-src/tests/webp/gdImageWebpEx.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/webp/gdImageWebpEx.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/webp/gdImageWebpEx.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,26 @@
+/**
+ * Basic testcase for gdImageWebpEx()
+ **/
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	FILE *fp1;
+	int size = 1;
+
+	im = gdImageCreateTrueColor(20, 20);
+	if (!im) {
+		return 1;
+	}
+
+	fp1 = gdTestTempFp();
+	gdImageWebpEx(im, fp1, 8);
+	gdImageWebpPtrEx(im, &size, 9);
+
+	fclose(fp1);
+
+	gdImageDestroy(im);
+	return 0;
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/webp/gdImageWebpEx.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gd/libgd-src/tests/xbm/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/CMakeLists.txt	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/CMakeLists.txt	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,11 @@
+LIST(APPEND TESTS_FILES
+	github_bug_501
+	github_bug_170
+)
+
 IF(PNG_FOUND)
 LIST(APPEND TESTS_FILES
 	github_bug_109
-	github_bug_170
 	x10_basic_read
 )
 ENDIF(PNG_FOUND)

Modified: trunk/Build/source/libs/gd/libgd-src/tests/xbm/Makemodule.am
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/Makemodule.am	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/Makemodule.am	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,7 +1,10 @@
+libgd_test_programs += \
+	xbm/github_bug_501 \
+	xbm/github_bug_170
+
 if HAVE_LIBPNG
 libgd_test_programs += \
 	xbm/github_bug_109 \
-	xbm/github_bug_170 \
 	xbm/x10_basic_read
 endif
 
@@ -10,4 +13,5 @@
 	xbm/github_bug_109.xbm \
 	xbm/github_bug_109_exp.png \
 	xbm/x10_basic_read.xbm \
-	xbm/x10_basic_read_exp.png
+	xbm/x10_basic_read_exp.png \
+	xbm/github_bug_501.xbm

Modified: trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_109.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_109.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_109.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -7,29 +7,27 @@
  * See also <https://github.com/libgd/libgd/issues/109>.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
-    im = gdImageCreateFromXbm(fp);
-    fclose(fp);
-    gdTestAssert(im != NULL);
-    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
-    gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
+	fp = gdTestFileOpen2("xbm", "github_bug_109.xbm");
+	im = gdImageCreateFromXbm(fp);
+	fclose(fp);
+	gdTestAssert(im != NULL);
+	gdTestAssert(gdImageGetTrueColorPixel(im, 0, 0) == 0);
+	gdTestAssert(gdImageGetTrueColorPixel(im, 0, 1) == 0xffffff);
 
-    path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("xbm", "github_bug_109_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_170.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_170.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_170.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -47,4 +47,4 @@
 	gdTestAssertMsg(length == 250, "expected to write 250 bytes; %jd bytes written", (intmax_t) length);
 	return gdNumFailures();
 }
-#endif
\ No newline at end of file
+#endif

Added: trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.c	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,39 @@
+/*
+	Test reading an invalid XBM image.
+
+	The pixels of the XBM image are invalid hex which makes the uninitialezed
+	variable be encoded into the output image i.e. information disclosure.
+	The image is 8*2.
+
+	See also <https://github.com/libgd/libgd/issues/501>.
+*/
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+
+	gdImagePtr im;
+	FILE *fp;
+
+	fp = gdTestFileOpen2("xbm", "github_bug_501.xbm");
+	im = gdImageCreateFromXbm(fp);
+
+	gdTestAssert(im == NULL);
+
+	if (im) {
+		gdTestErrorMsg("Info Disclosed\n");
+		int i;
+		for (i = 0; i < 8; i++) {
+			printf("Pixel(%d, 0) %0x\n", i, gdImageGetPixel(im, i, 0));
+		}
+		for (i = 0; i < 8; i++) {
+			printf("Pixel(%d, 1) %0x\n", i, gdImageGetPixel(im, i, 1));
+		}
+		gdImageDestroy(im);
+	}
+
+	fclose(fp);
+	return gdNumFailures();
+}


Property changes on: trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.xbm
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.xbm	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/github_bug_501.xbm	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,4 @@
+#define width 8
+#define height 2
+static char bits[] ={
+xzzxzz

Modified: trunk/Build/source/libs/gd/libgd-src/tests/xbm/x10_basic_read.c
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/tests/xbm/x10_basic_read.c	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/tests/xbm/x10_basic_read.c	2020-04-10 03:40:48 UTC (rev 54636)
@@ -6,27 +6,25 @@
  * which is 2 bytes instead of 1, and the endianess.
  */
 
-
 #include "gd.h"
 #include "gdtest.h"
 
-
 int main()
 {
-    gdImagePtr im;
-    FILE *fp;
-    char *path;
+	gdImagePtr im;
+	FILE *fp;
+	char *path;
 
-    fp = gdTestFileOpen2("xbm", "x10_basic_read.xbm");
-    im = gdImageCreateFromXbm(fp);
-    fclose(fp);
-    gdTestAssert(im != NULL);
+	fp = gdTestFileOpen2("xbm", "x10_basic_read.xbm");
+	im = gdImageCreateFromXbm(fp);
+	fclose(fp);
+	gdTestAssert(im != NULL);
 
-    path = gdTestFilePath2("xbm", "x10_basic_read_exp.png");
-    gdAssertImageEqualsToFile(path, im);
-    gdFree(path);
+	path = gdTestFilePath2("xbm", "x10_basic_read_exp.png");
+	gdAssertImageEqualsToFile(path, im);
+	gdFree(path);
 
-    gdImageDestroy(im);
+	gdImageDestroy(im);
 
-    return gdNumFailures();
+	return gdNumFailures();
 }

Modified: trunk/Build/source/libs/gd/libgd-src/windows/Makefile.vc
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/Makefile.vc	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/Makefile.vc	2020-04-10 03:40:48 UTC (rev 54636)
@@ -130,16 +130,16 @@
        /D_WIN32=1\
        /DMSWIN32=1\
        /DBGDWIN32=1\
+       /DENABLE_GD_FORMATS=1\
        /DHAVE_FT2BUILD_H=1\
        /DHAVE_GD_H=1\
        /DHAVE_ICONV_H=1\
-       /DHAVE_GD_BUNDLED=1\
        /DHAVE_LIBFREETYPE=1\
        /DHAVE_LIBJPEG=1\
        /DHAVE_LIBPNG=1\
-	   /DHAVE_LIBWEBP=1\
+       /DHAVE_LIBWEBP=1\
        /DHAVE_LIBZ=1\
-	   /DHAVE_LIBXPM=1\
+       /DHAVE_LIBXPM=1\
        /DHAVE_LIBTIFF=1\
        $(INCLUDES)
 

Added: trunk/Build/source/libs/gd/libgd-src/windows/Makefiletest.vc
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/Makefiletest.vc	                        (rev 0)
+++ trunk/Build/source/libs/gd/libgd-src/windows/Makefiletest.vc	2020-04-10 03:40:48 UTC (rev 54636)
@@ -0,0 +1,117 @@
+TESTS=bmp\bmp_im2im \
+bmp\bmp_null \
+freetype\bug00132 \
+gd\gd_im2im \
+gd\gd_null \
+gd\gd_num_colors \
+gd\gd_versiontest \
+gd2\gd2_empty_file \
+gd2\gd2_im2im \
+gd2\gd2_null \
+gd2\gd2_read \
+gd2\gd2_read_corrupt \
+gd2\php_bug_72339 \
+gdimagearc\bug00079 \
+gdimagecolorclosest\gdimagecolorclosest \
+gdimagecolordeallocate\gdimagecolordeallocate \
+gdimagecolorexact\gdimagecolorexact \
+gdimagecolorreplace\gdimagecolorreplace \
+gdimagecolorresolve\gdimagecolorresolve \
+gdimagecolortransparent\gdimagecolortransparent \
+gdimagecopy\bug00007 \
+gdimagecopy\bug00081 \
+gdimagecopyrotated\bug00020 \
+gdimagecrop\php_bug_72494 \
+gdimagefile\gdnametest \
+gdimagefill\bug00002_1 \
+gdimagefill\bug00002_2 \
+gdimagefill\bug00002_3 \
+gdimagefill\bug00002_4 \
+gdimagefill\bug00104_1 \
+gdimagefilledellipse\bug00010 \
+gdimagefilledellipse\bug00191 \
+gdimagefilledellipse\github_bug_00238 \
+gdimagefilledpolygon\bug00100 \
+gdimagefilledpolygon\gdimagefilledpolygon0 \
+gdimagefilledpolygon\gdimagefilledpolygon1 \
+gdimagefilledpolygon\gdimagefilledpolygon2 \
+gdimagefilledpolygon\gdimagefilledpolygon3 \
+gdimagefilledpolygon\php_bug_64641 \
+gdimagefilledrectangle\bug00004 \
+gdimagefilledrectangle\bug00078 \
+gdimagefilledrectangle\bug00106_gdimagefilledrectangle \
+gdimagefilltoborder\bug00037 \
+gdimagefilltoborder\github_bug_215 \
+gdimagefilter\gdCopyBlurred \
+gdimageline\bug00072 \
+gdimageline\bug00077 \
+gdimageline\bug00111 \
+gdimageline\gdImageAALine_thickness \
+gdimageline\gdimageline_aa \
+gdimageline\gdimageline_aa_outofrange \
+gdimageline\gdimageline_bug5 \
+gdimageline\github_bug_167 \
+gdimageopenpolygon\gdimageopenpolygon0 \
+gdimageopenpolygon\gdimageopenpolygon1 \
+gdimageopenpolygon\gdimageopenpolygon2 \
+gdimageopenpolygon\gdimageopenpolygon3 \
+gdimagepixelate\gdimagepixelate \
+gdimagepolygon\gdimagepolygon0 \
+gdimagepolygon\gdimagepolygon1 \
+gdimagepolygon\gdimagepolygon2 \
+gdimagepolygon\gdimagepolygon3 \
+gdimagerectangle\bug00003 \
+gdimagerectangle\bug00106_gdimagerectangle \
+gdimagerectangle\github_bug_00172 \
+gdimagerotate\bug00067 \
+gdimagerotate\php_bug_64898 \
+gdimagescale\github_bug_00218 \
+gdimagescatterex\bug00208_1 \
+gdimagescatterex\bug00208_2 \
+gdimagesetpixel\bug00186 \
+gdimagesetpixel\gdeffectmultiply \
+gdimagesetpixel\gdeffectoverlay \
+gdimagestringft\gdimagestringft_bbox \
+gdimagestringftex\gdimagestringftex_returnfontpathname \
+gdinterpolatedscale\gdModesAndPalettes \
+gdinterpolatedscale\gdTrivialResize \
+gdnewfilectx\gdnewfilectx_null \
+gdtiled\bug00032 \
+gdtransformaffineboundingbox\github_bug_00221 \
+gif\bug00005 \
+gif\bug00005_2 \
+gif\bug00006 \
+gif\bug00060 \
+gif\bug00066 \
+gif\bug00181 \
+gif\bug00227 \
+gif\gif_im2im \
+gif\gif_null \
+jpeg\bug_github_18 \
+jpeg\jpeg_empty_file \
+jpeg\jpeg_im2im \
+jpeg\jpeg_null \
+jpeg\jpeg_read \
+jpeg\jpeg_resolution \
+png\bug00011 \
+png\bug00033 \
+png\bug00086 \
+png\bug00088 \
+png\bug00193 \
+png\png_im2im \
+png\png_null \
+png\png_resolution \
+tga\bug00084 \
+tga\bug00247 \
+tga\bug00247a \
+tga\tga_null \
+tiff\tiff_dpi \
+tiff\tiff_im2im \
+tiff\tiff_null \
+wbmp\wbmp_im2im \
+wbmp\wbmp_null \
+webp\bug00111 \
+xbm\github_bug_170 \
+xpm\bug00166 \
+xpm\bug00185 \
+xpm\color_name

Modified: trunk/Build/source/libs/gd/libgd-src/windows/gentest.bat
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/gentest.bat	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/gentest.bat	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,35 +1,35 @@
-SETLOCAL ENABLEDELAYEDEXPANSION
- at echo off
-set testsdir=%~1
-set builddir=%~2
-set CFLAGS=%~3
-set LDFLAGS=%~4
-set CC=%~5
-set LD=%~6
-set TESTMK=%~7
-set TESTLIST=%~8
-echo %*
-echo recieved !testsdir! !builddir! !CFLAGS! !LDFLAGS! !CC!
-
-copy NUL !TESTMK! > nul
-copy NUL !TESTLIST! > nul
-
-for /D %%d in (!testsdir!/*) do (
-	if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
-		echo TEST_EXES=!builddir!\tests\%%d_%%~nf.exe ^$^(TEST_EXES^) >> !TESTMK!
-	)
-)
-
-for /D %%d in (!testsdir!/*) do (
-    if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
-		echo !builddir!\%%d_%%~nf.obj: !testsdir!\%%d\%%f; ^$^(CC^) ^$^(TEST_CFLAGS^) /c ^$** /Fd$*.pdb /Fo:$@  >> !TESTMK!
-	)
-)
-
-for /D %%d in (!testsdir!/*) do (
-    if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
-		echo !builddir!\tests\%%d_%%~nf.exe: !builddir!\%%d_%%~nf.obj; !LD! !LDFLAGS! $** /out:$@ >> !TESTMK!
-		echo %%d_%%~nf.exe >> !TESTLIST!
-	)
-)
-ENDLOCAL
\ No newline at end of file
+SETLOCAL ENABLEDELAYEDEXPANSION
+ at echo off
+set testsdir=%~1
+set builddir=%~2
+set CFLAGS=%~3
+set LDFLAGS=%~4
+set CC=%~5
+set LD=%~6
+set TESTMK=%~7
+set TESTLIST=%~8
+echo %*
+echo recieved !testsdir! !builddir! !CFLAGS! !LDFLAGS! !CC!
+
+copy NUL !TESTMK! > nul
+copy NUL !TESTLIST! > nul
+
+for /D %%d in (!testsdir!/*) do (
+	if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
+		echo TEST_EXES=!builddir!\tests\%%d_%%~nf.exe ^$^(TEST_EXES^) >> !TESTMK!
+	)
+)
+
+for /D %%d in (!testsdir!/*) do (
+    if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
+		echo !builddir!\%%d_%%~nf.obj: !testsdir!\%%d\%%f; ^$^(CC^) ^$^(TEST_CFLAGS^) /c ^$** /Fd$*.pdb /Fo:$@  >> !TESTMK!
+	)
+)
+
+for /D %%d in (!testsdir!/*) do (
+    if NOT "%%d"=="fontconfig" if NOT "%%d"=="gdtest" for %%f in (!testsdir!/%%d/*.c) do (
+		echo !builddir!\tests\%%d_%%~nf.exe: !builddir!\%%d_%%~nf.obj; !LD! !LDFLAGS! $** /out:$@ >> !TESTMK!
+		echo %%d_%%~nf.exe >> !TESTLIST!
+	)
+)
+ENDLOCAL

Modified: trunk/Build/source/libs/gd/libgd-src/windows/libgd.rc
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/libgd.rc	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/libgd.rc	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,5 +1,4 @@
 /* This is a template RC file.
- * $Id$
  * Do not edit with MSVC */
 #ifdef APSTUDIO_INVOKED
 # error dont edit with MSVC
@@ -38,7 +37,7 @@
             VALUE "FileDescription", "LIBGD" "\0"
             VALUE "FileVersion", GD_VERSION_STRING "\0"
             VALUE "InternalName", "bgd.dll" "\0"
-            VALUE "LegalCopyright", "Copyright \xA9 1997-2008 Thomas Boutell, Pierre A. Joye and contributors, see COPYING\0" 
+            VALUE "LegalCopyright", "Copyright \xA9 1997-2008 Thomas Boutell, Pierre A. Joye and contributors, see COPYING\0"
             VALUE "LegalTrademarks", "Thomas Boutell, Pierre A. Joye and contributors\0"
             VALUE "OriginalFilename", "bgd.dll" "\0"
             VALUE "PrivateBuild", "\0"
@@ -56,4 +55,3 @@
 #ifdef MC_INCLUDE
 #include MC_INCLUDE
 #endif
-

Modified: trunk/Build/source/libs/gd/libgd-src/windows/msys/Makefile
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/msys/Makefile	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/msys/Makefile	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 # Simple makefile for building and testing libgd under MSYS/MinGW on
 # Windows
 
@@ -7,9 +6,10 @@
 LIBVER=3.0.1
 
 # Misc. config flags.
-CDEFS=-DHAVE_ERRNO_H -DHAVE_ICONV -DHAVE_ICONV_H		\
--DHAVE_ICONV_T_DEF -DHAVE_INTTYPES_H -DHAVE_LIMITS_H -DHAVE_STDDEF_H	\
--DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_VISIBILITY -DICONV_CONST
+CDEFS=-DHAVE_ICONV -DHAVE_ICONV_H		\
+-DHAVE_ICONV_T_DEF -DHAVE_INTTYPES_H	\
+-DHAVE_STDINT_H -DHAVE_VISIBILITY -DICONV_CONST \
+-DENABLE_GD_FORMATS=1
 
 # GnuWin32 libs should all be installed in one place.
 GNUDIR=/c/tools/GnuWin32
@@ -131,13 +131,3 @@
 		$(OBJ) $(LIBS)
 
 include deps.mk
-
-
-
-
-
-
-
-
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/windows/msys/README.MSYS.md
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/msys/README.MSYS.md	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/msys/README.MSYS.md	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,4 +1,3 @@
-
 # MSYS Fallback Makefile
 
 This is a simple, straightforward Makefile for building LibGD with
@@ -49,6 +48,14 @@
     DLLs; it sweeps up all of the DLLs in the directories pointed to
     by *_DLLDIR Makefile variables.
 
+    Before type "make dist", please make sure you have installed
+    zip command in msys. Or you can try:
+    * If you use msys, you can install msys-zip(lib, docs, lic)
+    in MinGW Installation Manager/all package.
+    * If you use msys2, you can install msys/zip by pacman and running:
+
+       pacman -S msys/zip
+
     Alternately, you can copy the lib (in src/) to wherever it needs
     to go.
 
@@ -59,7 +66,3 @@
   worth.
 * LibFontconfig: I couldn't find Windows binaries for it anywhere
   reputable.
-
- 
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/windows/msys/run_tests.sh
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/msys/run_tests.sh	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/msys/run_tests.sh	2020-04-10 03:40:48 UTC (rev 54636)
@@ -5,11 +5,11 @@
 # Parameters
 DLLPATH_EXTRA=$1        # Path to supporting DLLs
 CFLAGS_EXTRA=$2         # Extra C flags
-    
 
+
 LOG=run_tests.log
 
-CFLAGS="-g -Igdtest/ -I. -I../src/ -D_WIN32 $CFLAGS_EXTRA"
+CFLAGS="-g -Igdtest/ -I. -I../src/ -D_WIN32 -DHAVE_SYS_STAT_H $CFLAGS_EXTRA"
 LDFLAGS='-L../src -llibgd'
 DLLPATH=../src:$DLLPATH_EXTRA
 
@@ -38,7 +38,7 @@
 count=0
 failures=0
 compile_failures=0
-for test in `find . -name \*.c | grep -v '^./gdtest'`; do
+for test in `find . -name \*.c | grep -vE '^./(fontconfig|gdtest|gdhelpers|xpm)'`; do
     count=`expr $count + 1`
 
     exe=${test%.c}.exe
@@ -49,7 +49,7 @@
         compile_failures=`expr $compile_failures + 1`
         continue
     fi
-    
+
     echo "Running $exe:" >> $LOG
     if $exe 2>&1 >> $LOG; then
         echo "PASS: $test"
@@ -62,6 +62,3 @@
 
 echo "$failures failures and $compile_failures compile failures out of $count tests."
 echo "Error messages in $LOG"
-
-
-

Modified: trunk/Build/source/libs/gd/libgd-src/windows/readme.md
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/readme.md	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/readme.md	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,53 +1,53 @@
-# Building on Windows with Visual Studio 2015
-
-* Get the required dependencies from
-  http://windows.php.net/downloads/php-sdk/deps/vc14/ and
-  http://windows.php.net/downloads/pecl/deps/, respectively. Choose the x86 or
-  x64 packages depending on your needs.
-  
-  * freetype
-  * libiconv
-  * libjpeg
-  * libpng
-  * libtiff
-  * libwebp
-  * libxpm
-  * zlib
-  
-* Unpack all dependency packages into the same folder.
-
-* Open the VS2015 x86 or x64 Native Tools Command Prompt.
-
-* Set the environment variable `WITH_DEVEL` to the path where you have unpacked
-  the dependencies. `WITH_DEVEL` defaults to `..\deps`.
-
-* If you want a debug build, do
-````
-set DEBUG=1
-````
-  
-* `cd` into the libgd source folder.
-
-* To build the libraries, do:
-```
-nmake /f windows\Makefile.vc
-```
-
-* To build and run the tests, do:
-````
-nmake /f windows\Makefile.vc check
-````
-
-* To build the executable programs, do:
-````
-nmake /f windows\Makefile.vc build_progs
-````
-
-* After a successful build, you find the libraries and test executables in
-  `..\gdbuild`. You can change the build folder by setting the environment
-  variable `WITH_BUILD` to the desired path.
-
-* Before rebuilding, you may have to run:
-```
-nmake /f windows\Makefile.vc clean
-```
+# Building on Windows with Visual Studio 2015
+
+* Get the required dependencies from
+  http://windows.php.net/downloads/php-sdk/deps/vc14/ and
+  http://windows.php.net/downloads/pecl/deps/, respectively. Choose the x86 or
+  x64 packages depending on your needs.
+
+  * freetype
+  * libiconv
+  * libjpeg
+  * libpng
+  * libtiff
+  * libwebp
+  * libxpm
+  * zlib
+
+* Unpack all dependency packages into the same folder.
+
+* Open the VS2015 x86 or x64 Native Tools Command Prompt.
+
+* Set the environment variable `WITH_DEVEL` to the path where you have unpacked
+  the dependencies. `WITH_DEVEL` defaults to `..\deps`.
+
+* If you want a debug build, do
+````
+set DEBUG=1
+````
+
+* `cd` into the libgd source folder.
+
+* To build the libraries, do:
+```
+nmake /f windows\Makefile.vc
+```
+
+* To build and run the tests, do:
+````
+nmake /f windows\Makefile.vc check
+````
+
+* To build the executable programs, do:
+````
+nmake /f windows\Makefile.vc build_progs
+````
+
+* After a successful build, you find the libraries and test executables in
+  `..\gdbuild`. You can change the build folder by setting the environment
+  variable `WITH_BUILD` to the desired path.
+
+* Before rebuilding, you may have to run:
+```
+nmake /f windows\Makefile.vc clean
+```

Modified: trunk/Build/source/libs/gd/libgd-src/windows/run_tests.bat
===================================================================
--- trunk/Build/source/libs/gd/libgd-src/windows/run_tests.bat	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/libgd-src/windows/run_tests.bat	2020-04-10 03:40:48 UTC (rev 54636)
@@ -1,43 +1,43 @@
- at echo off
-setlocal EnableDelayedExpansion
-if [%PLATFORM%]==[] set PLATFORM=x86
-if [%PREFERREDTOOLARCHITECTURE%]==[x64] set PLATFORM=x64
-set PLATFORM=%PLATFORM:X=x%
-
-set total=0
-set total_passed=0
-set total_failed=0
-set total_missing=0
-
-for /f %%T in (testlist.txt) do (
-  set test=%%T
-  set output=test: !test!....................................................................
-  set target=%%~nT.exe
-  if not exist !target! SET result=NotFound
-  call !target! && (SET result=Passed) || (SET result=Failed)
-  
-  rem > last_test.out 2> last_test.err
-  rem set /p testerr=<last_test.err
-  rem set /p testout=<last_test.out
-  
-  echo !output:~0,70!!result!
-  
-  rem if defined testerr echo error: !testerr!
-  rem if defined testout echo msg: !testout!
-  
-  set /a total=total+1
-  if "!result!"=="Passed" set /a total_passed=total_passed+1
-  if "!result!"=="Failed" set /a total_failed=total_failed+1
-  if "!result!"=="NotFound" set /a total_missing=total_missing+1
-
-  if defined APPVEYOR (
-    appveyor AddTest "!test! %PLATFORM%" -Outcome !result! -Framework Custom -Filename %%~nT.exe -Duration 0
-  )
-)
-echo.
-echo Tests:   !total!
-echo Passed:  !total_passed!
-echo Failed:  !total_failed!
-echo Missing: !total_missing!
-
-exit /b 0
\ No newline at end of file
+ at echo off
+setlocal EnableDelayedExpansion
+if [%PLATFORM%]==[] set PLATFORM=x86
+if [%PREFERREDTOOLARCHITECTURE%]==[x64] set PLATFORM=x64
+set PLATFORM=%PLATFORM:X=x%
+
+set total=0
+set total_passed=0
+set total_failed=0
+set total_missing=0
+
+for /f %%T in (testlist.txt) do (
+  set test=%%T
+  set output=test: !test!....................................................................
+  set target=%%~nT.exe
+  if not exist !target! SET result=NotFound
+  call !target! && (SET result=Passed) || (SET result=Failed)
+
+  rem > last_test.out 2> last_test.err
+  rem set /p testerr=<last_test.err
+  rem set /p testout=<last_test.out
+
+  echo !output:~0,70!!result!
+
+  rem if defined testerr echo error: !testerr!
+  rem if defined testout echo msg: !testout!
+
+  set /a total=total+1
+  if "!result!"=="Passed" set /a total_passed=total_passed+1
+  if "!result!"=="Failed" set /a total_failed=total_failed+1
+  if "!result!"=="NotFound" set /a total_missing=total_missing+1
+
+  if defined APPVEYOR (
+    appveyor AddTest "!test! %PLATFORM%" -Outcome !result! -Framework Custom -Filename %%~nT.exe -Duration 0
+  )
+)
+echo.
+echo Tests:   !total!
+echo Passed:  !total_passed!
+echo Failed:  !total_failed!
+echo Missing: !total_missing!
+
+exit /b 0

Modified: trunk/Build/source/libs/gd/version.ac
===================================================================
--- trunk/Build/source/libs/gd/version.ac	2020-04-10 00:57:29 UTC (rev 54635)
+++ trunk/Build/source/libs/gd/version.ac	2020-04-10 03:40:48 UTC (rev 54636)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current gd version
-m4_define([gd_version], [2.2.5])
+m4_define([gd_version], [2.3.0])



More information about the tex-live-commits mailing list.