• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Révision1aece932bb29c5ad15a12c82badf231bcb55a74c (tree)
l'heure2022-01-15 09:08:18
AuteurBob Friesenhahn <bfriesen@Grap...>
CommiterBob Friesenhahn

Message de Log

Merge heif

Change Summary

Modification

diff -r b067afcd6aa7 -r 1aece932bb29 ChangeLog
--- a/ChangeLog Fri Jan 14 15:01:00 2022 -0600
+++ b/ChangeLog Fri Jan 14 18:08:18 2022 -0600
@@ -1,5 +1,8 @@
11 2022-01-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
22
3+ * coders/heif.c: HEIF reader written by Tobias Mark. From
4+ SourceForge Code Merge Request #15: "Added minimal heif support".
5+
36 * magick/blob.c (ReadBlobStream): Fix EOF logic similar to
47 ReadBlob. Addresses oss-fuzz 43617
58 "graphicsmagick:coder_P7_fuzzer: Use-of-uninitialized-value in
diff -r b067afcd6aa7 -r 1aece932bb29 Makefile.in
--- a/Makefile.in Fri Jan 14 15:01:00 2022 -0600
+++ b/Makefile.in Fri Jan 14 18:08:18 2022 -0600
@@ -522,6 +522,15 @@
522522 $(AM_CFLAGS) $(CFLAGS) $(coders_gray_la_LDFLAGS) $(LDFLAGS) -o \
523523 $@
524524 @WITH_MODULES_TRUE@am_coders_gray_la_rpath = -rpath $(codersdir)
525+coders_heif_la_DEPENDENCIES = $(LIBMAGICK) $(am__DEPENDENCIES_1)
526+am_coders_heif_la_OBJECTS = coders/heif_la-heif.lo
527+coders_heif_la_OBJECTS = $(am_coders_heif_la_OBJECTS)
528+coders_heif_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
529+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
530+ $(AM_CFLAGS) $(CFLAGS) $(coders_heif_la_LDFLAGS) $(LDFLAGS) -o \
531+ $@
532+@HasHEIF_TRUE@@WITH_MODULES_TRUE@am_coders_heif_la_rpath = -rpath \
533+@HasHEIF_TRUE@@WITH_MODULES_TRUE@ $(codersdir)
525534 coders_histogram_la_DEPENDENCIES = $(LIBMAGICK)
526535 am_coders_histogram_la_OBJECTS = coders/histogram_la-histogram.lo
527536 coders_histogram_la_OBJECTS = $(am_coders_histogram_la_OBJECTS)
@@ -1219,7 +1228,7 @@
12191228 coders/psd.c coders/dps.c coders/clipboard.c coders/emf.c \
12201229 coders/fpx.c coders/jbig.c coders/jnx.c coders/jpeg.c \
12211230 coders/jp2.c coders/ept.c coders/tiff.c coders/x.c \
1222- coders/xwd.c coders/webp.c filters/analyze.c
1231+ coders/xwd.c coders/webp.c coders/heif.c filters/analyze.c
12231232 @HasX11_TRUE@am__objects_1 = magick/libGraphicsMagick_la-animate.lo \
12241233 @HasX11_TRUE@ magick/libGraphicsMagick_la-display.lo \
12251234 @HasX11_TRUE@ magick/libGraphicsMagick_la-PreRvIcccm.lo \
@@ -1325,7 +1334,9 @@
13251334 @HasX11_TRUE@ coders/magick_libGraphicsMagick_la-xwd.lo
13261335 @HasWEBP_TRUE@am__objects_14 = \
13271336 @HasWEBP_TRUE@ coders/magick_libGraphicsMagick_la-webp.lo
1328-am__objects_15 = $(am__objects_4) \
1337+@HasHEIF_TRUE@am__objects_15 = \
1338+@HasHEIF_TRUE@ coders/magick_libGraphicsMagick_la-heif.lo
1339+am__objects_16 = $(am__objects_4) \
13291340 coders/magick_libGraphicsMagick_la-art.lo \
13301341 coders/magick_libGraphicsMagick_la-avs.lo \
13311342 coders/magick_libGraphicsMagick_la-bmp.lo \
@@ -1414,11 +1425,12 @@
14141425 coders/magick_libGraphicsMagick_la-yuv.lo $(am__objects_5) \
14151426 $(am__objects_6) $(am__objects_7) $(am__objects_8) \
14161427 $(am__objects_9) $(am__objects_10) $(am__objects_11) \
1417- $(am__objects_12) $(am__objects_13) $(am__objects_14)
1418-am__objects_16 = filters/magick_libGraphicsMagick_la-analyze.lo
1428+ $(am__objects_12) $(am__objects_13) $(am__objects_14) \
1429+ $(am__objects_15)
1430+am__objects_17 = filters/magick_libGraphicsMagick_la-analyze.lo
14191431 @WITH_MODULES_FALSE@am_magick_libGraphicsMagick_la_OBJECTS = \
14201432 @WITH_MODULES_FALSE@ $(am__objects_2) $(am__objects_3) \
1421-@WITH_MODULES_FALSE@ $(am__objects_15) $(am__objects_16)
1433+@WITH_MODULES_FALSE@ $(am__objects_16) $(am__objects_17)
14221434 @WITH_MODULES_TRUE@am_magick_libGraphicsMagick_la_OBJECTS = \
14231435 @WITH_MODULES_TRUE@ $(am__objects_2) $(am__objects_3)
14241436 magick_libGraphicsMagick_la_OBJECTS = \
@@ -1429,11 +1441,11 @@
14291441 $(LDFLAGS) -o $@
14301442 wand_libGraphicsMagickWand_la_DEPENDENCIES = $(LIBMAGICK) \
14311443 $(am__DEPENDENCIES_1)
1432-am__objects_17 = wand/libGraphicsMagickWand_la-drawing_wand.lo \
1444+am__objects_18 = wand/libGraphicsMagickWand_la-drawing_wand.lo \
14331445 wand/libGraphicsMagickWand_la-magick_compat.lo \
14341446 wand/libGraphicsMagickWand_la-magick_wand.lo \
14351447 wand/libGraphicsMagickWand_la-pixel_wand.lo
1436-am_wand_libGraphicsMagickWand_la_OBJECTS = $(am__objects_17)
1448+am_wand_libGraphicsMagickWand_la_OBJECTS = $(am__objects_18)
14371449 wand_libGraphicsMagickWand_la_OBJECTS = \
14381450 $(am_wand_libGraphicsMagickWand_la_OBJECTS)
14391451 wand_libGraphicsMagickWand_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@@ -1644,6 +1656,7 @@
16441656 coders/$(DEPDIR)/gif_la-gif.Plo \
16451657 coders/$(DEPDIR)/gradient_la-gradient.Plo \
16461658 coders/$(DEPDIR)/gray_la-gray.Plo \
1659+ coders/$(DEPDIR)/heif_la-heif.Plo \
16471660 coders/$(DEPDIR)/histogram_la-histogram.Plo \
16481661 coders/$(DEPDIR)/hrz_la-hrz.Plo \
16491662 coders/$(DEPDIR)/html_la-html.Plo \
@@ -1681,6 +1694,7 @@
16811694 coders/$(DEPDIR)/magick_libGraphicsMagick_la-gif.Plo \
16821695 coders/$(DEPDIR)/magick_libGraphicsMagick_la-gradient.Plo \
16831696 coders/$(DEPDIR)/magick_libGraphicsMagick_la-gray.Plo \
1697+ coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Plo \
16841698 coders/$(DEPDIR)/magick_libGraphicsMagick_la-histogram.Plo \
16851699 coders/$(DEPDIR)/magick_libGraphicsMagick_la-hrz.Plo \
16861700 coders/$(DEPDIR)/magick_libGraphicsMagick_la-html.Plo \
@@ -1965,46 +1979,47 @@
19651979 $(coders_ept_la_SOURCES) $(coders_fax_la_SOURCES) \
19661980 $(coders_fits_la_SOURCES) $(coders_fpx_la_SOURCES) \
19671981 $(coders_gif_la_SOURCES) $(coders_gradient_la_SOURCES) \
1968- $(coders_gray_la_SOURCES) $(coders_histogram_la_SOURCES) \
1969- $(coders_hrz_la_SOURCES) $(coders_html_la_SOURCES) \
1970- $(coders_icon_la_SOURCES) $(coders_identity_la_SOURCES) \
1971- $(coders_info_la_SOURCES) $(coders_jbig_la_SOURCES) \
1972- $(coders_jnx_la_SOURCES) $(coders_jp2_la_SOURCES) \
1973- $(coders_jpeg_la_SOURCES) $(coders_label_la_SOURCES) \
1974- $(coders_locale_la_SOURCES) $(coders_logo_la_SOURCES) \
1975- $(coders_mac_la_SOURCES) $(coders_map_la_SOURCES) \
1976- $(coders_mat_la_SOURCES) $(coders_matte_la_SOURCES) \
1977- $(coders_meta_la_SOURCES) $(coders_miff_la_SOURCES) \
1978- $(coders_mono_la_SOURCES) $(coders_mpc_la_SOURCES) \
1979- $(coders_mpeg_la_SOURCES) $(coders_mpr_la_SOURCES) \
1980- $(coders_msl_la_SOURCES) $(coders_mtv_la_SOURCES) \
1981- $(coders_mvg_la_SOURCES) $(coders_null_la_SOURCES) \
1982- $(coders_otb_la_SOURCES) $(coders_palm_la_SOURCES) \
1983- $(coders_pcd_la_SOURCES) $(coders_pcl_la_SOURCES) \
1984- $(coders_pcx_la_SOURCES) $(coders_pdb_la_SOURCES) \
1985- $(coders_pdf_la_SOURCES) $(coders_pict_la_SOURCES) \
1986- $(coders_pix_la_SOURCES) $(coders_plasma_la_SOURCES) \
1987- $(coders_png_la_SOURCES) $(coders_pnm_la_SOURCES) \
1988- $(coders_preview_la_SOURCES) $(coders_ps_la_SOURCES) \
1989- $(coders_ps2_la_SOURCES) $(coders_ps3_la_SOURCES) \
1990- $(coders_psd_la_SOURCES) $(coders_pwp_la_SOURCES) \
1991- $(coders_rgb_la_SOURCES) $(coders_rla_la_SOURCES) \
1992- $(coders_rle_la_SOURCES) $(coders_sct_la_SOURCES) \
1993- $(coders_sfw_la_SOURCES) $(coders_sgi_la_SOURCES) \
1994- $(coders_stegano_la_SOURCES) $(coders_sun_la_SOURCES) \
1995- $(coders_svg_la_SOURCES) $(coders_tga_la_SOURCES) \
1996- $(coders_tiff_la_SOURCES) $(coders_tile_la_SOURCES) \
1997- $(coders_tim_la_SOURCES) $(coders_topol_la_SOURCES) \
1998- $(coders_ttf_la_SOURCES) $(coders_txt_la_SOURCES) \
1999- $(coders_uil_la_SOURCES) $(coders_url_la_SOURCES) \
2000- $(coders_uyvy_la_SOURCES) $(coders_vicar_la_SOURCES) \
2001- $(coders_vid_la_SOURCES) $(coders_viff_la_SOURCES) \
2002- $(coders_wbmp_la_SOURCES) $(coders_webp_la_SOURCES) \
2003- $(coders_wmf_la_SOURCES) $(coders_wpg_la_SOURCES) \
2004- $(coders_x_la_SOURCES) $(coders_xbm_la_SOURCES) \
2005- $(coders_xc_la_SOURCES) $(coders_xcf_la_SOURCES) \
2006- $(coders_xpm_la_SOURCES) $(coders_xwd_la_SOURCES) \
2007- $(coders_yuv_la_SOURCES) $(filters_analyze_la_SOURCES) \
1982+ $(coders_gray_la_SOURCES) $(coders_heif_la_SOURCES) \
1983+ $(coders_histogram_la_SOURCES) $(coders_hrz_la_SOURCES) \
1984+ $(coders_html_la_SOURCES) $(coders_icon_la_SOURCES) \
1985+ $(coders_identity_la_SOURCES) $(coders_info_la_SOURCES) \
1986+ $(coders_jbig_la_SOURCES) $(coders_jnx_la_SOURCES) \
1987+ $(coders_jp2_la_SOURCES) $(coders_jpeg_la_SOURCES) \
1988+ $(coders_label_la_SOURCES) $(coders_locale_la_SOURCES) \
1989+ $(coders_logo_la_SOURCES) $(coders_mac_la_SOURCES) \
1990+ $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \
1991+ $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \
1992+ $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \
1993+ $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \
1994+ $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \
1995+ $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \
1996+ $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \
1997+ $(coders_palm_la_SOURCES) $(coders_pcd_la_SOURCES) \
1998+ $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \
1999+ $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \
2000+ $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \
2001+ $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \
2002+ $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \
2003+ $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \
2004+ $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \
2005+ $(coders_pwp_la_SOURCES) $(coders_rgb_la_SOURCES) \
2006+ $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \
2007+ $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \
2008+ $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \
2009+ $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \
2010+ $(coders_tga_la_SOURCES) $(coders_tiff_la_SOURCES) \
2011+ $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \
2012+ $(coders_topol_la_SOURCES) $(coders_ttf_la_SOURCES) \
2013+ $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \
2014+ $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \
2015+ $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \
2016+ $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \
2017+ $(coders_webp_la_SOURCES) $(coders_wmf_la_SOURCES) \
2018+ $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \
2019+ $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \
2020+ $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \
2021+ $(coders_xwd_la_SOURCES) $(coders_yuv_la_SOURCES) \
2022+ $(filters_analyze_la_SOURCES) \
20082023 $(magick_libGraphicsMagick_la_SOURCES) \
20092024 $(wand_libGraphicsMagickWand_la_SOURCES) \
20102025 $(Magick___demo_analyze_SOURCES) \
@@ -2042,46 +2057,47 @@
20422057 $(coders_ept_la_SOURCES) $(coders_fax_la_SOURCES) \
20432058 $(coders_fits_la_SOURCES) $(coders_fpx_la_SOURCES) \
20442059 $(coders_gif_la_SOURCES) $(coders_gradient_la_SOURCES) \
2045- $(coders_gray_la_SOURCES) $(coders_histogram_la_SOURCES) \
2046- $(coders_hrz_la_SOURCES) $(coders_html_la_SOURCES) \
2047- $(coders_icon_la_SOURCES) $(coders_identity_la_SOURCES) \
2048- $(coders_info_la_SOURCES) $(coders_jbig_la_SOURCES) \
2049- $(coders_jnx_la_SOURCES) $(coders_jp2_la_SOURCES) \
2050- $(coders_jpeg_la_SOURCES) $(coders_label_la_SOURCES) \
2051- $(coders_locale_la_SOURCES) $(coders_logo_la_SOURCES) \
2052- $(coders_mac_la_SOURCES) $(coders_map_la_SOURCES) \
2053- $(coders_mat_la_SOURCES) $(coders_matte_la_SOURCES) \
2054- $(coders_meta_la_SOURCES) $(coders_miff_la_SOURCES) \
2055- $(coders_mono_la_SOURCES) $(coders_mpc_la_SOURCES) \
2056- $(coders_mpeg_la_SOURCES) $(coders_mpr_la_SOURCES) \
2057- $(coders_msl_la_SOURCES) $(coders_mtv_la_SOURCES) \
2058- $(coders_mvg_la_SOURCES) $(coders_null_la_SOURCES) \
2059- $(coders_otb_la_SOURCES) $(coders_palm_la_SOURCES) \
2060- $(coders_pcd_la_SOURCES) $(coders_pcl_la_SOURCES) \
2061- $(coders_pcx_la_SOURCES) $(coders_pdb_la_SOURCES) \
2062- $(coders_pdf_la_SOURCES) $(coders_pict_la_SOURCES) \
2063- $(coders_pix_la_SOURCES) $(coders_plasma_la_SOURCES) \
2064- $(coders_png_la_SOURCES) $(coders_pnm_la_SOURCES) \
2065- $(coders_preview_la_SOURCES) $(coders_ps_la_SOURCES) \
2066- $(coders_ps2_la_SOURCES) $(coders_ps3_la_SOURCES) \
2067- $(coders_psd_la_SOURCES) $(coders_pwp_la_SOURCES) \
2068- $(coders_rgb_la_SOURCES) $(coders_rla_la_SOURCES) \
2069- $(coders_rle_la_SOURCES) $(coders_sct_la_SOURCES) \
2070- $(coders_sfw_la_SOURCES) $(coders_sgi_la_SOURCES) \
2071- $(coders_stegano_la_SOURCES) $(coders_sun_la_SOURCES) \
2072- $(coders_svg_la_SOURCES) $(coders_tga_la_SOURCES) \
2073- $(coders_tiff_la_SOURCES) $(coders_tile_la_SOURCES) \
2074- $(coders_tim_la_SOURCES) $(coders_topol_la_SOURCES) \
2075- $(coders_ttf_la_SOURCES) $(coders_txt_la_SOURCES) \
2076- $(coders_uil_la_SOURCES) $(coders_url_la_SOURCES) \
2077- $(coders_uyvy_la_SOURCES) $(coders_vicar_la_SOURCES) \
2078- $(coders_vid_la_SOURCES) $(coders_viff_la_SOURCES) \
2079- $(coders_wbmp_la_SOURCES) $(coders_webp_la_SOURCES) \
2080- $(coders_wmf_la_SOURCES) $(coders_wpg_la_SOURCES) \
2081- $(coders_x_la_SOURCES) $(coders_xbm_la_SOURCES) \
2082- $(coders_xc_la_SOURCES) $(coders_xcf_la_SOURCES) \
2083- $(coders_xpm_la_SOURCES) $(coders_xwd_la_SOURCES) \
2084- $(coders_yuv_la_SOURCES) $(filters_analyze_la_SOURCES) \
2060+ $(coders_gray_la_SOURCES) $(coders_heif_la_SOURCES) \
2061+ $(coders_histogram_la_SOURCES) $(coders_hrz_la_SOURCES) \
2062+ $(coders_html_la_SOURCES) $(coders_icon_la_SOURCES) \
2063+ $(coders_identity_la_SOURCES) $(coders_info_la_SOURCES) \
2064+ $(coders_jbig_la_SOURCES) $(coders_jnx_la_SOURCES) \
2065+ $(coders_jp2_la_SOURCES) $(coders_jpeg_la_SOURCES) \
2066+ $(coders_label_la_SOURCES) $(coders_locale_la_SOURCES) \
2067+ $(coders_logo_la_SOURCES) $(coders_mac_la_SOURCES) \
2068+ $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \
2069+ $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \
2070+ $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \
2071+ $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \
2072+ $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \
2073+ $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \
2074+ $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \
2075+ $(coders_palm_la_SOURCES) $(coders_pcd_la_SOURCES) \
2076+ $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \
2077+ $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \
2078+ $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \
2079+ $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \
2080+ $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \
2081+ $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \
2082+ $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \
2083+ $(coders_pwp_la_SOURCES) $(coders_rgb_la_SOURCES) \
2084+ $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \
2085+ $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \
2086+ $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \
2087+ $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \
2088+ $(coders_tga_la_SOURCES) $(coders_tiff_la_SOURCES) \
2089+ $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \
2090+ $(coders_topol_la_SOURCES) $(coders_ttf_la_SOURCES) \
2091+ $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \
2092+ $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \
2093+ $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \
2094+ $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \
2095+ $(coders_webp_la_SOURCES) $(coders_wmf_la_SOURCES) \
2096+ $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \
2097+ $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \
2098+ $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \
2099+ $(coders_xwd_la_SOURCES) $(coders_yuv_la_SOURCES) \
2100+ $(filters_analyze_la_SOURCES) \
20852101 $(am__magick_libGraphicsMagick_la_SOURCES_DIST) \
20862102 $(wand_libGraphicsMagickWand_la_SOURCES) \
20872103 $(Magick___demo_analyze_SOURCES) \
@@ -2486,6 +2502,7 @@
24862502 LIB_DPS = @LIB_DPS@
24872503 LIB_FPX = @LIB_FPX@
24882504 LIB_GDI32 = @LIB_GDI32@
2505+LIB_HEIF = @LIB_HEIF@
24892506 LIB_JBIG = @LIB_JBIG@
24902507 LIB_JP2 = @LIB_JP2@
24912508 LIB_JPEG = @LIB_JPEG@
@@ -2869,6 +2886,8 @@
28692886 @HasX11_TRUE@MAGICK_X11_CODER_SRCS = coders/x.c coders/xwd.c
28702887 @HasWEBP_TRUE@MAGICK_WEBP_MODULES = coders/webp.la
28712888 @HasWEBP_TRUE@MAGICK_WEBP_SRCS = coders/webp.c
2889+@HasHEIF_TRUE@MAGICK_HEIF_MODULES = coders/heif.la
2890+@HasHEIF_TRUE@MAGICK_HEIF_SRCS = coders/heif.c
28722891 @ENABLE_BROKEN_CODERS_TRUE@MAGICK_BROKEN_MODULES = coders/psd.la
28732892 @ENABLE_BROKEN_CODERS_TRUE@MAGICK_BROKEN_SRCS = coders/psd.c
28742893 MAGICK_CODER_CPPFLAGS = \
@@ -2972,7 +2991,8 @@
29722991 $(MAGICK_JP2_SRCS) \
29732992 $(MAGICK_TIFF_SRCS) \
29742993 $(MAGICK_X11_CODER_SRCS) \
2975- $(MAGICK_WEBP_SRCS)
2994+ $(MAGICK_WEBP_SRCS) \
2995+ $(MAGICK_HEIF_SRCS)
29762996
29772997 @WITH_MODULES_FALSE@coders_LTLIBRARIES =
29782998 @WITH_MODULES_TRUE@coders_LTLIBRARIES = \
@@ -3066,7 +3086,7 @@
30663086 @WITH_MODULES_TRUE@ $(MAGICK_DPS_MODULES) $(MAGICK_FPX_MODULES) $(MAGICK_GDI32_MODULES) \
30673087 @WITH_MODULES_TRUE@ $(MAGICK_JBIG_MODULES) $(MAGICK_JPEG_MODULES) $(MAGICK_JP2_MODULES) \
30683088 @WITH_MODULES_TRUE@ $(MAGICK_PNG_MODULES) $(MAGICK_TIFF_MODULES) $(MAGICK_X11_CODER_MODULES) \
3069-@WITH_MODULES_TRUE@ $(MAGICK_WEBP_MODULES)
3089+@WITH_MODULES_TRUE@ $(MAGICK_WEBP_MODULES) $(MAGICK_HEIF_MODULES)
30703090
30713091
30723092 # ART coder module
@@ -3674,6 +3694,12 @@
36743694 coders_webp_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
36753695 coders_webp_la_LDFLAGS = $(MODULECOMMONFLAGS)
36763696 coders_webp_la_LIBADD = $(LIBMAGICK) $(LIB_WEBP)
3697+
3698+# HEIF coder module
3699+coders_heif_la_SOURCES = coders/heif.c
3700+coders_heif_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
3701+coders_heif_la_LDFLAGS = $(MODULECOMMONFLAGS)
3702+coders_heif_la_LIBADD = $(LIBMAGICK) $(LIB_HEIF)
36773703 magickincdir = $(topincludedir)/magick
36783704
36793705 # Headers which are installed
@@ -5344,6 +5370,11 @@
53445370
53455371 coders/gray.la: $(coders_gray_la_OBJECTS) $(coders_gray_la_DEPENDENCIES) $(EXTRA_coders_gray_la_DEPENDENCIES) coders/$(am__dirstamp)
53465372 $(AM_V_CCLD)$(coders_gray_la_LINK) $(am_coders_gray_la_rpath) $(coders_gray_la_OBJECTS) $(coders_gray_la_LIBADD) $(LIBS)
5373+coders/heif_la-heif.lo: coders/$(am__dirstamp) \
5374+ coders/$(DEPDIR)/$(am__dirstamp)
5375+
5376+coders/heif.la: $(coders_heif_la_OBJECTS) $(coders_heif_la_DEPENDENCIES) $(EXTRA_coders_heif_la_DEPENDENCIES) coders/$(am__dirstamp)
5377+ $(AM_V_CCLD)$(coders_heif_la_LINK) $(am_coders_heif_la_rpath) $(coders_heif_la_OBJECTS) $(coders_heif_la_LIBADD) $(LIBS)
53475378 coders/histogram_la-histogram.lo: coders/$(am__dirstamp) \
53485379 coders/$(DEPDIR)/$(am__dirstamp)
53495380
@@ -6115,6 +6146,8 @@
61156146 coders/$(DEPDIR)/$(am__dirstamp)
61166147 coders/magick_libGraphicsMagick_la-webp.lo: coders/$(am__dirstamp) \
61176148 coders/$(DEPDIR)/$(am__dirstamp)
6149+coders/magick_libGraphicsMagick_la-heif.lo: coders/$(am__dirstamp) \
6150+ coders/$(DEPDIR)/$(am__dirstamp)
61186151 filters/magick_libGraphicsMagick_la-analyze.lo: \
61196152 filters/$(am__dirstamp) filters/$(DEPDIR)/$(am__dirstamp)
61206153
@@ -6471,6 +6504,7 @@
64716504 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/gif_la-gif.Plo@am__quote@ # am--include-marker
64726505 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/gradient_la-gradient.Plo@am__quote@ # am--include-marker
64736506 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/gray_la-gray.Plo@am__quote@ # am--include-marker
6507+@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/heif_la-heif.Plo@am__quote@ # am--include-marker
64746508 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/histogram_la-histogram.Plo@am__quote@ # am--include-marker
64756509 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/hrz_la-hrz.Plo@am__quote@ # am--include-marker
64766510 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/html_la-html.Plo@am__quote@ # am--include-marker
@@ -6508,6 +6542,7 @@
65086542 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-gif.Plo@am__quote@ # am--include-marker
65096543 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-gradient.Plo@am__quote@ # am--include-marker
65106544 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-gray.Plo@am__quote@ # am--include-marker
6545+@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Plo@am__quote@ # am--include-marker
65116546 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-histogram.Plo@am__quote@ # am--include-marker
65126547 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-hrz.Plo@am__quote@ # am--include-marker
65136548 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-html.Plo@am__quote@ # am--include-marker
@@ -6931,6 +6966,13 @@
69316966 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
69326967 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_gray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/gray_la-gray.lo `test -f 'coders/gray.c' || echo '$(srcdir)/'`coders/gray.c
69336968
6969+coders/heif_la-heif.lo: coders/heif.c
6970+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_heif_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/heif_la-heif.lo -MD -MP -MF coders/$(DEPDIR)/heif_la-heif.Tpo -c -o coders/heif_la-heif.lo `test -f 'coders/heif.c' || echo '$(srcdir)/'`coders/heif.c
6971+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/heif_la-heif.Tpo coders/$(DEPDIR)/heif_la-heif.Plo
6972+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='coders/heif.c' object='coders/heif_la-heif.lo' libtool=yes @AMDEPBACKSLASH@
6973+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
6974+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_heif_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/heif_la-heif.lo `test -f 'coders/heif.c' || echo '$(srcdir)/'`coders/heif.c
6975+
69346976 coders/histogram_la-histogram.lo: coders/histogram.c
69356977 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_histogram_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/histogram_la-histogram.lo -MD -MP -MF coders/$(DEPDIR)/histogram_la-histogram.Tpo -c -o coders/histogram_la-histogram.lo `test -f 'coders/histogram.c' || echo '$(srcdir)/'`coders/histogram.c
69366978 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/histogram_la-histogram.Tpo coders/$(DEPDIR)/histogram_la-histogram.Plo
@@ -8758,6 +8800,13 @@
87588800 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
87598801 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libGraphicsMagick_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/magick_libGraphicsMagick_la-webp.lo `test -f 'coders/webp.c' || echo '$(srcdir)/'`coders/webp.c
87608802
8803+coders/magick_libGraphicsMagick_la-heif.lo: coders/heif.c
8804+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libGraphicsMagick_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/magick_libGraphicsMagick_la-heif.lo -MD -MP -MF coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Tpo -c -o coders/magick_libGraphicsMagick_la-heif.lo `test -f 'coders/heif.c' || echo '$(srcdir)/'`coders/heif.c
8805+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Tpo coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Plo
8806+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='coders/heif.c' object='coders/magick_libGraphicsMagick_la-heif.lo' libtool=yes @AMDEPBACKSLASH@
8807+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
8808+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libGraphicsMagick_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/magick_libGraphicsMagick_la-heif.lo `test -f 'coders/heif.c' || echo '$(srcdir)/'`coders/heif.c
8809+
87618810 filters/magick_libGraphicsMagick_la-analyze.lo: filters/analyze.c
87628811 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libGraphicsMagick_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT filters/magick_libGraphicsMagick_la-analyze.lo -MD -MP -MF filters/$(DEPDIR)/magick_libGraphicsMagick_la-analyze.Tpo -c -o filters/magick_libGraphicsMagick_la-analyze.lo `test -f 'filters/analyze.c' || echo '$(srcdir)/'`filters/analyze.c
87638812 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) filters/$(DEPDIR)/magick_libGraphicsMagick_la-analyze.Tpo filters/$(DEPDIR)/magick_libGraphicsMagick_la-analyze.Plo
@@ -10206,6 +10255,7 @@
1020610255 -rm -f coders/$(DEPDIR)/gif_la-gif.Plo
1020710256 -rm -f coders/$(DEPDIR)/gradient_la-gradient.Plo
1020810257 -rm -f coders/$(DEPDIR)/gray_la-gray.Plo
10258+ -rm -f coders/$(DEPDIR)/heif_la-heif.Plo
1020910259 -rm -f coders/$(DEPDIR)/histogram_la-histogram.Plo
1021010260 -rm -f coders/$(DEPDIR)/hrz_la-hrz.Plo
1021110261 -rm -f coders/$(DEPDIR)/html_la-html.Plo
@@ -10243,6 +10293,7 @@
1024310293 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gif.Plo
1024410294 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gradient.Plo
1024510295 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gray.Plo
10296+ -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Plo
1024610297 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-histogram.Plo
1024710298 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-hrz.Plo
1024810299 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-html.Plo
@@ -10594,6 +10645,7 @@
1059410645 -rm -f coders/$(DEPDIR)/gif_la-gif.Plo
1059510646 -rm -f coders/$(DEPDIR)/gradient_la-gradient.Plo
1059610647 -rm -f coders/$(DEPDIR)/gray_la-gray.Plo
10648+ -rm -f coders/$(DEPDIR)/heif_la-heif.Plo
1059710649 -rm -f coders/$(DEPDIR)/histogram_la-histogram.Plo
1059810650 -rm -f coders/$(DEPDIR)/hrz_la-hrz.Plo
1059910651 -rm -f coders/$(DEPDIR)/html_la-html.Plo
@@ -10631,6 +10683,7 @@
1063110683 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gif.Plo
1063210684 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gradient.Plo
1063310685 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-gray.Plo
10686+ -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-heif.Plo
1063410687 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-histogram.Plo
1063510688 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-hrz.Plo
1063610689 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-html.Plo
diff -r b067afcd6aa7 -r 1aece932bb29 README.txt
--- a/README.txt Fri Jan 14 15:01:00 2022 -0600
+++ b/README.txt Fri Jan 14 18:08:18 2022 -0600
@@ -377,3 +377,9 @@
377377 https://github.com/ebiggers/libdeflate). Linking with this
378378 library may be necessary for builds where libtiff depends on
379379 libdeflate.
380+
381+* GraphicsMagick requires the heif library from
382+
383+ https://github.com/strukturag/libheif
384+
385+ to read heif/heic files.
diff -r b067afcd6aa7 -r 1aece932bb29 coders/Makefile.am
--- a/coders/Makefile.am Fri Jan 14 15:01:00 2022 -0600
+++ b/coders/Makefile.am Fri Jan 14 18:08:18 2022 -0600
@@ -61,6 +61,11 @@
6161 MAGICK_WEBP_SRCS = coders/webp.c
6262 endif
6363
64+if HasHEIF
65+MAGICK_HEIF_MODULES = coders/heif.la
66+MAGICK_HEIF_SRCS = coders/heif.c
67+endif
68+
6469 if ENABLE_BROKEN_CODERS
6570 MAGICK_BROKEN_MODULES = coders/psd.la
6671 MAGICK_BROKEN_SRCS = coders/psd.c
@@ -167,7 +172,8 @@
167172 $(MAGICK_JP2_SRCS) \
168173 $(MAGICK_TIFF_SRCS) \
169174 $(MAGICK_X11_CODER_SRCS) \
170- $(MAGICK_WEBP_SRCS)
175+ $(MAGICK_WEBP_SRCS) \
176+ $(MAGICK_HEIF_SRCS)
171177
172178 if WITH_MODULES
173179 coders_LTLIBRARIES = \
@@ -261,7 +267,7 @@
261267 $(MAGICK_DPS_MODULES) $(MAGICK_FPX_MODULES) $(MAGICK_GDI32_MODULES) \
262268 $(MAGICK_JBIG_MODULES) $(MAGICK_JPEG_MODULES) $(MAGICK_JP2_MODULES) \
263269 $(MAGICK_PNG_MODULES) $(MAGICK_TIFF_MODULES) $(MAGICK_X11_CODER_MODULES) \
264- $(MAGICK_WEBP_MODULES)
270+ $(MAGICK_WEBP_MODULES) $(MAGICK_HEIF_MODULES)
265271 else
266272 coders_LTLIBRARIES =
267273 endif # WITH_MODULES
@@ -871,3 +877,9 @@
871877 coders_webp_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
872878 coders_webp_la_LDFLAGS = $(MODULECOMMONFLAGS)
873879 coders_webp_la_LIBADD = $(LIBMAGICK) $(LIB_WEBP)
880+
881+# HEIF coder module
882+coders_heif_la_SOURCES = coders/heif.c
883+coders_heif_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
884+coders_heif_la_LDFLAGS = $(MODULECOMMONFLAGS)
885+coders_heif_la_LIBADD = $(LIBMAGICK) $(LIB_HEIF)
diff -r b067afcd6aa7 -r 1aece932bb29 coders/heif.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coders/heif.c Fri Jan 14 18:08:18 2022 -0600
@@ -0,0 +1,382 @@
1+/*
2+% Copyright (C) 2022 GraphicsMagick Group
3+%
4+% This program is covered by multiple licenses, which are described in
5+% Copyright.txt. You should have received a copy of Copyright.txt with this
6+% package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
7+%
8+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9+% %
10+% %
11+% H H EEEEE I FFFFF %
12+% H H E I F %
13+% HHHHH EEEEE I FFFF %
14+% H H E I F %
15+% H H EEEEE I F %
16+% %
17+% Read Heif/Heic Image Format. %
18+% %
19+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20+* Status: Support for reading a single image.
21+*/
22+
23+#include "magick/studio.h"
24+#include "magick/blob.h"
25+#include "magick/colormap.h"
26+#include "magick/log.h"
27+#include "magick/constitute.h"
28+#include "magick/magick.h"
29+#include "magick/monitor.h"
30+#include "magick/pixel_cache.h"
31+#include "magick/profile.h"
32+#include "magick/utility.h"
33+#include "magick/resource.h"
34+
35+#if defined(HasHEIF)
36+#include <libheif/heif.h>
37+
38+/*
39+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40+% %
41+% %
42+% %
43+% R e a d H E I F I m a g e %
44+% %
45+% %
46+% %
47+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48+%
49+% ReadHEIFImage() reads an image in the HEIF image format.
50+%
51+% The format of the ReadHEIFImage method is:
52+%
53+% Image *ReadHEIFImage(const ImageInfo *image_info,
54+% ExceptionInfo *exception)
55+%
56+% A description of each parameter follows:
57+%
58+% o image_info: the image info.
59+%
60+% o exception: return any errors or warnings in this structure.
61+%
62+*/
63+
64+#define HEIFReadCleanup() \
65+ if (heif_image) heif_image_release(heif_image); \
66+ if (heif_image_handle) heif_image_handle_release(heif_image_handle); \
67+ if (heif) heif_context_free(heif); \
68+ MagickFreeResourceLimitedMemory(in_buf)
69+
70+#define ThrowHEIFReaderException(code_,reason_,image_) \
71+ { \
72+ HEIFReadCleanup(); \
73+ ThrowReaderException(code_,reason_,image_) \
74+ }
75+
76+
77+static Image *ReadMetadata(struct heif_image_handle *heif_image_handle,
78+ Image *image, ExceptionInfo *exception)
79+{
80+ int
81+ count,
82+ i;
83+
84+ heif_item_id
85+ *ids;
86+
87+ struct heif_error
88+ err;
89+
90+ count=heif_image_handle_get_number_of_metadata_blocks(heif_image_handle, NULL);
91+ if (count==0)
92+ return image;
93+
94+ ids=MagickAllocateResourceLimitedArray(heif_item_id *,count,sizeof(*ids));
95+ if (ids == (heif_item_id *) NULL)
96+ ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
97+
98+ count=heif_image_handle_get_list_of_metadata_block_IDs(heif_image_handle, NULL,
99+ ids,count);
100+
101+ for (i=0; i<count; i++)
102+ {
103+ const char*
104+ profile_name=heif_image_handle_get_metadata_type(heif_image_handle,ids[i]);
105+
106+ size_t
107+ profile_size=heif_image_handle_get_metadata_size(heif_image_handle,ids[i]);
108+
109+ unsigned char*
110+ profile;
111+
112+ profile=MagickAllocateResourceLimitedArray(unsigned char*,profile_size,
113+ sizeof(*profile));
114+ if (profile == (unsigned char*) NULL)
115+ {
116+ MagickFreeResourceLimitedMemory(ids);
117+ ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
118+ }
119+
120+ err=heif_image_handle_get_metadata(heif_image_handle,ids[i],profile);
121+
122+ if (err.code != heif_error_Ok)
123+ {
124+ MagickFreeResourceLimitedMemory(profile);
125+ MagickFreeResourceLimitedMemory(ids);
126+ ThrowReaderException(CorruptImageError,
127+ AnErrorHasOccurredReadingFromFile,image);
128+ }
129+
130+ if (strncmp(profile_name,"Exif",4) == 0 && profile_size > 4)
131+ {
132+ /* skip TIFF-Header */
133+ SetImageProfile(image,profile_name,profile+4,profile_size-4);
134+ }
135+ else
136+ {
137+ SetImageProfile(image,profile_name,profile,profile_size);
138+ }
139+ MagickFreeResourceLimitedMemory(profile);
140+ }
141+ MagickFreeResourceLimitedMemory(ids);
142+ return image;
143+}
144+
145+static Image *ReadHEIFImage(const ImageInfo *image_info,
146+ ExceptionInfo *exception)
147+{
148+ Image
149+ *image;
150+
151+ struct heif_context
152+ *heif = NULL;
153+
154+ struct heif_error
155+ heif_status;
156+
157+ struct heif_image_handle
158+ *heif_image_handle = NULL;
159+
160+ struct heif_image
161+ *heif_image = NULL;
162+
163+ size_t
164+ in_len;
165+
166+ int
167+ row_stride;
168+
169+ unsigned char
170+ *in_buf = NULL;
171+
172+ const uint8_t
173+ *pixels = NULL;
174+
175+ long
176+ x,
177+ y;
178+
179+ PixelPacket
180+ *q;
181+
182+ assert(image_info != (const ImageInfo *) NULL);
183+ assert(image_info->signature == MagickSignature);
184+ assert(exception != (ExceptionInfo *) NULL);
185+ assert(exception->signature == MagickSignature);
186+
187+ /*
188+ Open image file.
189+ */
190+ image=AllocateImage(image_info);
191+ if (image == (Image *) NULL)
192+ ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
193+
194+ if (OpenBlob(image_info,image,ReadBinaryBlobMode,exception) == MagickFail)
195+ ThrowReaderException(FileOpenError,UnableToOpenFile,image);
196+
197+ in_len=GetBlobSize(image);
198+ in_buf=MagickAllocateResourceLimitedArray(unsigned char *,in_len,sizeof(*in_buf));
199+ if (in_buf == (unsigned char *) NULL)
200+ ThrowHEIFReaderException(ResourceLimitError,MemoryAllocationFailed,image);
201+
202+ if (ReadBlob(image,in_len,in_buf) != in_len)
203+ ThrowHEIFReaderException(CorruptImageError, UnexpectedEndOfFile, image);
204+
205+ /* Init HEIF-Decoder handles */
206+ heif=heif_context_alloc();
207+
208+ heif_status=heif_context_read_from_memory(heif, in_buf, in_len, NULL);
209+ if (heif_status.code == heif_error_Unsupported_filetype
210+ || heif_status.code == heif_error_Unsupported_feature)
211+ ThrowHEIFReaderException(CoderError, ImageTypeNotSupported, image);
212+ if (heif_status.code != heif_error_Ok)
213+ ThrowHEIFReaderException(CorruptImageError, AnErrorHasOccurredReadingFromFile, image);
214+
215+ /* no support for reading multiple images but could be added */
216+ if (heif_context_get_number_of_top_level_images(heif) != 1)
217+ ThrowHEIFReaderException(CoderError, NumberOfImagesIsNotSupported, image);
218+
219+ heif_status=heif_context_get_primary_image_handle(heif, &heif_image_handle);
220+ if (heif_status.code == heif_error_Memory_allocation_error)
221+ ThrowHEIFReaderException(ResourceLimitError,MemoryAllocationFailed,image);
222+ if (heif_status.code != heif_error_Ok)
223+ ThrowHEIFReaderException(CorruptImageError, AnErrorHasOccurredReadingFromFile, image);
224+
225+ image->columns=heif_image_handle_get_width(heif_image_handle);
226+ image->rows=heif_image_handle_get_height(heif_image_handle);
227+ if (heif_image_handle_has_alpha_channel(heif_image_handle))
228+ image->matte=MagickTrue;
229+
230+ if (!ReadMetadata(heif_image_handle, image, exception))
231+ {
232+ HEIFReadCleanup();
233+ return NULL;
234+ }
235+
236+ heif_status=heif_decode_image(heif_image_handle, &heif_image,
237+ heif_colorspace_RGB, image->matte ? heif_chroma_interleaved_RGBA :
238+ heif_chroma_interleaved_RGB, NULL);
239+ if (heif_status.code == heif_error_Memory_allocation_error)
240+ ThrowHEIFReaderException(ResourceLimitError,MemoryAllocationFailed,image);
241+ if (heif_status.code != heif_error_Ok)
242+ ThrowHEIFReaderException(CorruptImageError, AnErrorHasOccurredReadingFromFile, image);
243+
244+ image->depth=heif_image_get_bits_per_pixel(heif_image, heif_channel_interleaved);
245+ /* the requested channel is interleaved there depth is a sum of all channels
246+ split it up again: */
247+ if (image->depth == 32 && image->matte)
248+ image->depth = 8;
249+ else if (image->depth == 24 && !image->matte)
250+ image->depth = 8;
251+ else
252+ ThrowHEIFReaderException(CoderError, UnsupportedBitsPerSample, image);
253+
254+ pixels=heif_image_get_plane_readonly(heif_image, heif_channel_interleaved, &row_stride);
255+ if (!pixels)
256+ ThrowHEIFReaderException(CoderError, NoDataReturned, image);
257+
258+ for (y=0; y < (long)image->rows; y++)
259+ {
260+ q=SetImagePixelsEx(image,0,y,image->columns,1,exception);
261+ if (q == (PixelPacket *) NULL)
262+ ThrowHEIFReaderException(ResourceLimitError,MemoryAllocationFailed,image);
263+ for (x=0; x < (long)image->columns; x++)
264+ {
265+ SetRedSample(q,ScaleCharToQuantum(*pixels++));
266+ SetGreenSample(q,ScaleCharToQuantum(*pixels++));
267+ SetBlueSample(q,ScaleCharToQuantum(*pixels++));
268+ if (image->matte) {
269+ SetOpacitySample(q,MaxRGB-ScaleCharToQuantum(*pixels++));
270+ } else {
271+ SetOpacitySample(q,OpaqueOpacity);
272+ }
273+ q++;
274+ }
275+ if (!SyncImagePixels(image))
276+ ThrowHEIFReaderException(ResourceLimitError,MemoryAllocationFailed,image);
277+ }
278+
279+ HEIFReadCleanup();
280+ CloseBlob(image);
281+ return image;
282+}
283+
284+#endif
285+
286+/*
287+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288+% %
289+% %
290+% %
291+% R e g i s t e r H E I F I m a g e %
292+% %
293+% %
294+% %
295+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296+%
297+% Method RegisterHEIFImage adds attributes for the HEIF image format to
298+% the list of supported formats. The attributes include the image format
299+% tag, a method to read and/or write the format and a brief
300+% description of the format.
301+%
302+% The format of the RegisterHEIFImage method is:
303+%
304+% RegisterHEIFImage(void)
305+%
306+*/
307+ModuleExport void RegisterHEIFImage(void)
308+{
309+ static const char
310+ description[] = "HEIF Image Format";
311+
312+ static char
313+ version[20];
314+
315+ MagickInfo
316+ *entry;
317+
318+ unsigned int
319+ heif_major,
320+ heif_minor,
321+ heif_revision;
322+
323+ int encoder_version=heif_get_version_number();
324+ heif_major=(encoder_version >> 16) & 0xff;
325+ heif_minor=(encoder_version >> 8) & 0xff;
326+ heif_revision=encoder_version & 0xff;
327+ *version='\0';
328+ (void) sprintf(version,
329+ "heif v%u.%u.%u", heif_major,
330+ heif_minor, heif_revision);
331+
332+ entry=SetMagickInfo("HEIF");
333+#if defined(HasHEIF)
334+ entry->decoder=(DecoderHandler) ReadHEIFImage;
335+#endif
336+ entry->description=description;
337+ entry->adjoin=False;
338+ entry->seekable_stream=MagickTrue;
339+ if (*version != '\0')
340+ entry->version=version;
341+ entry->module="HEIF";
342+ entry->coder_class=PrimaryCoderClass;
343+ (void) RegisterMagickInfo(entry);
344+
345+ entry=SetMagickInfo("HEIC");
346+#if defined(HasHEIF)
347+ entry->decoder=(DecoderHandler) ReadHEIFImage;
348+#endif
349+ entry->description=description;
350+ entry->adjoin=False;
351+ entry->seekable_stream=MagickTrue;
352+ if (*version != '\0')
353+ entry->version=version;
354+ entry->module="HEIF";
355+ entry->coder_class=PrimaryCoderClass;
356+ (void) RegisterMagickInfo(entry);
357+}
358+
359+/*
360+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
361+% %
362+% %
363+% %
364+% U n r e g i s t e r H E I F I m a g e %
365+% %
366+% %
367+% %
368+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
369+%
370+% Method UnregisterHEIFImage removes format registrations made by the
371+% HEIF module from the list of supported formats.
372+%
373+% The format of the UnregisterHEIFImage method is:
374+%
375+% UnregisterHEIFImage(void)
376+%
377+*/
378+ModuleExport void UnregisterHEIFImage(void)
379+{
380+ (void) UnregisterMagickInfo("HEIF");
381+ (void) UnregisterMagickInfo("HEIC");
382+}
diff -r b067afcd6aa7 -r 1aece932bb29 config/config.guess
--- a/config/config.guess Fri Jan 14 15:01:00 2022 -0600
+++ b/config/config.guess Fri Jan 14 18:08:18 2022 -0600
@@ -1,14 +1,14 @@
11 #! /bin/sh
22 # Attempt to guess a canonical system name.
3-# Copyright 1992-2021 Free Software Foundation, Inc.
3+# Copyright 1992-2022 Free Software Foundation, Inc.
44
55 # shellcheck disable=SC2006,SC2268 # see below for rationale
66
7-timestamp='2021-06-03'
7+timestamp='2022-01-09'
88
99 # This file is free software; you can redistribute it and/or modify it
1010 # under the terms of the GNU General Public License as published by
11-# the Free Software Foundation; either version 3 of the License, or
11+# the Free Software Foundation, either version 3 of the License, or
1212 # (at your option) any later version.
1313 #
1414 # This program is distributed in the hope that it will be useful, but
@@ -60,7 +60,7 @@
6060 GNU config.guess ($timestamp)
6161
6262 Originally written by Per Bothner.
63-Copyright 1992-2021 Free Software Foundation, Inc.
63+Copyright 1992-2022 Free Software Foundation, Inc.
6464
6565 This is free software; see the source for copying conditions. There is NO
6666 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -437,7 +437,7 @@
437437 # This test works for both compilers.
438438 if test "$CC_FOR_BUILD" != no_compiler_found; then
439439 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
440- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
440+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
441441 grep IS_64BIT_ARCH >/dev/null
442442 then
443443 SUN_ARCH=x86_64
@@ -929,6 +929,9 @@
929929 i*:PW*:*)
930930 GUESS=$UNAME_MACHINE-pc-pw32
931931 ;;
932+ *:SerenityOS:*:*)
933+ GUESS=$UNAME_MACHINE-pc-serenity
934+ ;;
932935 *:Interix*:*)
933936 case $UNAME_MACHINE in
934937 x86)
@@ -1522,6 +1525,9 @@
15221525 i*86:rdos:*:*)
15231526 GUESS=$UNAME_MACHINE-pc-rdos
15241527 ;;
1528+ i*86:Fiwix:*:*)
1529+ GUESS=$UNAME_MACHINE-pc-fiwix
1530+ ;;
15251531 *:AROS:*:*)
15261532 GUESS=$UNAME_MACHINE-unknown-aros
15271533 ;;
diff -r b067afcd6aa7 -r 1aece932bb29 config/config.sub
--- a/config/config.sub Fri Jan 14 15:01:00 2022 -0600
+++ b/config/config.sub Fri Jan 14 18:08:18 2022 -0600
@@ -1,14 +1,14 @@
11 #! /bin/sh
22 # Configuration validation subroutine script.
3-# Copyright 1992-2021 Free Software Foundation, Inc.
3+# Copyright 1992-2022 Free Software Foundation, Inc.
44
55 # shellcheck disable=SC2006,SC2268 # see below for rationale
66
7-timestamp='2021-08-14'
7+timestamp='2022-01-03'
88
99 # This file is free software; you can redistribute it and/or modify it
1010 # under the terms of the GNU General Public License as published by
11-# the Free Software Foundation; either version 3 of the License, or
11+# the Free Software Foundation, either version 3 of the License, or
1212 # (at your option) any later version.
1313 #
1414 # This program is distributed in the hope that it will be useful, but
@@ -76,7 +76,7 @@
7676 version="\
7777 GNU config.sub ($timestamp)
7878
79-Copyright 1992-2021 Free Software Foundation, Inc.
79+Copyright 1992-2022 Free Software Foundation, Inc.
8080
8181 This is free software; see the source for copying conditions. There is NO
8282 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -1020,6 +1020,11 @@
10201020 ;;
10211021
10221022 # Here we normalize CPU types with a missing or matching vendor
1023+ armh-unknown | armh-alt)
1024+ cpu=armv7l
1025+ vendor=alt
1026+ basic_os=${basic_os:-linux-gnueabihf}
1027+ ;;
10231028 dpx20-unknown | dpx20-bull)
10241029 cpu=rs6000
10251030 vendor=bull
@@ -1121,7 +1126,7 @@
11211126 xscale-* | xscalee[bl]-*)
11221127 cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
11231128 ;;
1124- arm64-*)
1129+ arm64-* | aarch64le-*)
11251130 cpu=aarch64
11261131 ;;
11271132
@@ -1304,7 +1309,7 @@
13041309 if test x$basic_os != x
13051310 then
13061311
1307-# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
1312+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
13081313 # set os.
13091314 case $basic_os in
13101315 gnu/linux*)
@@ -1748,7 +1753,8 @@
17481753 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
17491754 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
17501755 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1751- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
1756+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1757+ | fiwix* )
17521758 ;;
17531759 # This one is extra strict with allowed versions
17541760 sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
diff -r b067afcd6aa7 -r 1aece932bb29 configure
--- a/configure Fri Jan 14 15:01:00 2022 -0600
+++ b/configure Fri Jan 14 18:08:18 2022 -0600
@@ -734,6 +734,9 @@
734734 XML_LIBS
735735 XML_CFLAGS
736736 xml2_config
737+LIB_HEIF
738+HasHEIF_FALSE
739+HasHEIF_TRUE
737740 LIB_WEBP
738741 HasWEBP_FALSE
739742 HasWEBP_TRUE
@@ -1067,6 +1070,7 @@
10671070 with_gs
10681071 with_jbig
10691072 with_webp
1073+with_heif
10701074 with_jpeg
10711075 with_jp2
10721076 with_lcms2
@@ -1792,6 +1796,7 @@
17921796 --without-gs disable Ghostscript support
17931797 --without-jbig disable JBIG support
17941798 --without-webp disable WEBP support
1799+ --without-heif disable HEIF support
17951800 --without-jpeg disable JPEG support
17961801 --without-jp2 disable JPEG v2 support
17971802 --without-lcms2 disable lcms (v2.X) support
@@ -19426,6 +19431,19 @@
1942619431 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
1942719432 fi
1942819433
19434+# Disable HEIF.
19435+
19436+# Check whether --with-heif was given.
19437+if test "${with_heif+set}" = set; then :
19438+ withval=$with_heif; with_heif=$withval
19439+else
19440+ with_heif='yes'
19441+fi
19442+
19443+if test "$with_heif" != 'yes' ; then
19444+ DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heif=$with_heif "
19445+fi
19446+
1942919447 # Disable JPEG.
1943019448
1943119449 # Check whether --with-jpeg was given.
@@ -27191,6 +27209,103 @@
2719127209
2719227210
2719327211
27212+# Check for HEIF
27213+#
27214+have_heif='no'
27215+LIB_HEIF=''
27216+if test "$with_heif" != 'no'
27217+then
27218+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEIF support " >&5
27219+$as_echo_n "checking for HEIF support ... " >&6; }
27220+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
27221+$as_echo "" >&6; }
27222+ failed=0
27223+ passed=0
27224+ ac_fn_c_check_header_mongrel "$LINENO" "libheif/heif.h" "ac_cv_header_libheif_heif_h" "$ac_includes_default"
27225+if test "x$ac_cv_header_libheif_heif_h" = xyes; then :
27226+ passed=`expr $passed + 1`
27227+else
27228+ failed=`expr $failed + 1`
27229+fi
27230+
27231+
27232+ # heif always requires hwy no extra test needed
27233+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for heif_context_alloc in -lheif" >&5
27234+$as_echo_n "checking for heif_context_alloc in -lheif... " >&6; }
27235+if ${ac_cv_lib_heif_heif_context_alloc+:} false; then :
27236+ $as_echo_n "(cached) " >&6
27237+else
27238+ ac_check_lib_save_LIBS=$LIBS
27239+LIBS="-lheif $LIBS"
27240+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27241+/* end confdefs.h. */
27242+
27243+/* Override any GCC internal prototype to avoid an error.
27244+ Use char because int might match the return type of a GCC
27245+ builtin and then its argument prototype would still apply. */
27246+#ifdef __cplusplus
27247+extern "C"
27248+#endif
27249+char heif_context_alloc ();
27250+int
27251+main ()
27252+{
27253+return heif_context_alloc ();
27254+ ;
27255+ return 0;
27256+}
27257+_ACEOF
27258+if ac_fn_c_try_link "$LINENO"; then :
27259+ ac_cv_lib_heif_heif_context_alloc=yes
27260+else
27261+ ac_cv_lib_heif_heif_context_alloc=no
27262+fi
27263+rm -f core conftest.err conftest.$ac_objext \
27264+ conftest$ac_exeext conftest.$ac_ext
27265+LIBS=$ac_check_lib_save_LIBS
27266+fi
27267+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_heif_heif_context_alloc" >&5
27268+$as_echo "$ac_cv_lib_heif_heif_context_alloc" >&6; }
27269+if test "x$ac_cv_lib_heif_heif_context_alloc" = xyes; then :
27270+ passed=`expr $passed + 1`
27271+else
27272+ failed=`expr $failed + 1`
27273+fi
27274+
27275+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if HEIF package is complete" >&5
27276+$as_echo_n "checking if HEIF package is complete... " >&6; }
27277+ if test $passed -gt 0
27278+ then
27279+ if test $failed -gt 0
27280+ then
27281+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no -- some components failed test" >&5
27282+$as_echo "no -- some components failed test" >&6; }
27283+ have_heif='no (failed tests)'
27284+ else
27285+ LIB_HEIF='-lheif'
27286+ LIBS="$LIB_HEIF $LIBS"
27287+
27288+$as_echo "#define HasHEIF 1" >>confdefs.h
27289+
27290+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27291+$as_echo "yes" >&6; }
27292+ have_heif='yes'
27293+ fi
27294+ else
27295+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27296+$as_echo "no" >&6; }
27297+ fi
27298+fi
27299+ if test "$have_heif" = 'yes'; then
27300+ HasHEIF_TRUE=
27301+ HasHEIF_FALSE='#'
27302+else
27303+ HasHEIF_TRUE='#'
27304+ HasHEIF_FALSE=
27305+fi
27306+
27307+
27308+
2719427309 #
2719527310 # Check for XML
2719627311 #
@@ -30063,6 +30178,10 @@
3006330178 DELEGATES="$DELEGATES webp"
3006430179 MAGICK_FEATURES="$MAGICK_FEATURES WEBP"
3006530180 fi
30181+if test "$have_heif" = 'yes' ; then
30182+ DELEGATES="$DELEGATES heif"
30183+ MAGICK_FEATURES="$MAGICK_FEATURES HEIF"
30184+fi
3006630185 if test "$have_png$have_jpeg" = 'yesyes' ; then
3006730186 DELEGATES="$DELEGATES jng"
3006830187 MAGICK_FEATURES="$MAGICK_FEATURES JNG"
@@ -30184,7 +30303,7 @@
3018430303 then
3018530304 MAGICK_DEP_LIBS="$LIBS_USER $LIB_LCMS $LIB_TTF $LIB_GS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_BZLIB $LIB_ZLIB $LIB_LTDL $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
3018630305 else
30187- MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
30306+ MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_HEIF $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
3018830307 fi
3018930308 MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
3019030309
@@ -30555,6 +30674,10 @@
3055530674 as_fn_error $? "conditional \"HasWEBP\" was never defined.
3055630675 Usually this means the macro was only invoked conditionally." "$LINENO" 5
3055730676 fi
30677+if test -z "${HasHEIF_TRUE}" && test -z "${HasHEIF_FALSE}"; then
30678+ as_fn_error $? "conditional \"HasHEIF\" was never defined.
30679+Usually this means the macro was only invoked conditionally." "$LINENO" 5
30680+fi
3055830681 if test -z "${HasXML_TRUE}" && test -z "${HasXML_FALSE}"; then
3055930682 as_fn_error $? "conditional \"HasXML\" was never defined.
3056030683 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -33116,6 +33239,7 @@
3311633239 printf "TIFF --with-tiff=$with_tiff \t$have_tiff\n"
3311733240 printf "TRIO --with-trio=$with_trio \t$have_trio\n"
3311833241 printf "WEBP --with-webp=$with_webp \t$have_webp\n"
33242+printf "HEIF --with-heif=$with_heif \t$have_heif\n"
3311933243 result_windows_font_dir='none'
3312033244 if test "${windows_font_dir}x" != 'x'
3312133245 then
diff -r b067afcd6aa7 -r 1aece932bb29 configure.ac
--- a/configure.ac Fri Jan 14 15:01:00 2022 -0600
+++ b/configure.ac Fri Jan 14 18:08:18 2022 -0600
@@ -689,6 +689,16 @@
689689 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
690690 fi
691691
692+# Disable HEIF.
693+AC_ARG_WITH([heif],
694+ AS_HELP_STRING([--without-heif],
695+ [disable HEIF support]),
696+ [with_heif=$withval],
697+ [with_heif='yes'])
698+if test "$with_heif" != 'yes' ; then
699+ DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heif=$with_heif "
700+fi
701+
692702 # Disable JPEG.
693703 AC_ARG_WITH([jpeg],
694704 AS_HELP_STRING([--without-jpeg],
@@ -2535,6 +2545,40 @@
25352545 AM_CONDITIONAL([HasWEBP],[test "$have_webp" = 'yes'])
25362546 AC_SUBST([LIB_WEBP])
25372547
2548+# Check for HEIF
2549+#
2550+have_heif='no'
2551+LIB_HEIF=''
2552+if test "$with_heif" != 'no'
2553+then
2554+ AC_MSG_CHECKING([for HEIF support ])
2555+ AC_MSG_RESULT()
2556+ failed=0
2557+ passed=0
2558+ AC_CHECK_HEADER([libheif/heif.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2559+ # heif always requires hwy no extra test needed
2560+ AC_CHECK_LIB([heif],[heif_context_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2561+ AC_MSG_CHECKING([if HEIF package is complete])
2562+ if test $passed -gt 0
2563+ then
2564+ if test $failed -gt 0
2565+ then
2566+ AC_MSG_RESULT([no -- some components failed test])
2567+ have_heif='no (failed tests)'
2568+ else
2569+ LIB_HEIF='-lheif'
2570+ LIBS="$LIB_HEIF $LIBS"
2571+ AC_DEFINE([HasHEIF],[1],[Define if you have HEIF library])
2572+ AC_MSG_RESULT([yes])
2573+ have_heif='yes'
2574+ fi
2575+ else
2576+ AC_MSG_RESULT([no])
2577+ fi
2578+fi
2579+AM_CONDITIONAL([HasHEIF],[test "$have_heif" = 'yes'])
2580+AC_SUBST([LIB_HEIF])
2581+
25382582 #
25392583 # Check for XML
25402584 #
@@ -3576,6 +3620,10 @@
35763620 DELEGATES="$DELEGATES webp"
35773621 MAGICK_FEATURES="$MAGICK_FEATURES WEBP"
35783622 fi
3623+if test "$have_heif" = 'yes' ; then
3624+ DELEGATES="$DELEGATES heif"
3625+ MAGICK_FEATURES="$MAGICK_FEATURES HEIF"
3626+fi
35793627 if test "$have_png$have_jpeg" = 'yesyes' ; then
35803628 DELEGATES="$DELEGATES jng"
35813629 MAGICK_FEATURES="$MAGICK_FEATURES JNG"
@@ -3701,7 +3749,7 @@
37013749 then
37023750 MAGICK_DEP_LIBS="$LIBS_USER $LIB_LCMS $LIB_TTF $LIB_GS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_BZLIB $LIB_ZLIB $LIB_LTDL $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
37033751 else
3704- MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
3752+ MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_HEIF $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
37053753 fi
37063754 MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
37073755 AC_SUBST([MAGICK_DEP_LIBS])
@@ -3845,6 +3893,7 @@
38453893 printf "TIFF --with-tiff=$with_tiff \t$have_tiff\n"
38463894 printf "TRIO --with-trio=$with_trio \t$have_trio\n"
38473895 printf "WEBP --with-webp=$with_webp \t$have_webp\n"
3896+printf "HEIF --with-heif=$with_heif \t$have_heif\n"
38483897 result_windows_font_dir='none'
38493898 if test "${windows_font_dir}x" != 'x'
38503899 then
diff -r b067afcd6aa7 -r 1aece932bb29 magick/magick_config.h.in
--- a/magick/magick_config.h.in Fri Jan 14 15:01:00 2022 -0600
+++ b/magick/magick_config.h.in Fri Jan 14 18:08:18 2022 -0600
@@ -426,6 +426,9 @@
426426 /* Enable use of Ghostscript */
427427 #undef HasGS
428428
429+/* Define if you have HEIF library */
430+#undef HasHEIF
431+
429432 /* Define if you have JBIG library */
430433 #undef HasJBIG
431434
diff -r b067afcd6aa7 -r 1aece932bb29 magick/module_aliases.h
--- a/magick/module_aliases.h Fri Jan 14 15:01:00 2022 -0600
+++ b/magick/module_aliases.h Fri Jan 14 18:08:18 2022 -0600
@@ -74,6 +74,7 @@
7474 MODULEALIAS("H","LOGO"),
7575 MODULEALIAS("HTM","HTML"),
7676 MODULEALIAS("HTTP","URL"),
77+ MODULEALIAS("HEIC","HEIF"),
7778 MODULEALIAS("ICB","TGA"),
7879 MODULEALIAS("ICC","META"),
7980 MODULEALIAS("ICM","META"),
diff -r b067afcd6aa7 -r 1aece932bb29 magick/static.c
--- a/magick/static.c Fri Jan 14 15:01:00 2022 -0600
+++ b/magick/static.c Fri Jan 14 18:08:18 2022 -0600
@@ -96,6 +96,9 @@
9696 STATICM("HISTOGRAM",RegisterHISTOGRAMImage,UnregisterHISTOGRAMImage),
9797 STATICM("HRZ",RegisterHRZImage,UnregisterHRZImage),
9898 STATICM("HTML",RegisterHTMLImage,UnregisterHTMLImage),
99+#if defined(HasHEIF)
100+ STATICM("HEIF",RegisterHEIFImage,UnregisterHEIFImage),
101+#endif
99102 STATICM("ICON",RegisterICONImage,UnregisterICONImage),
100103 STATICM("IDENTITY",RegisterIDENTITYImage,UnregisterIDENTITYImage),
101104 STATICM("INFO",RegisterINFOImage,UnregisterINFOImage),
diff -r b067afcd6aa7 -r 1aece932bb29 magick/static.h
--- a/magick/static.h Fri Jan 14 15:01:00 2022 -0600
+++ b/magick/static.h Fri Jan 14 18:08:18 2022 -0600
@@ -149,6 +149,7 @@
149149 RegisterVSTImage(void),
150150 RegisterWBMPImage(void),
151151 RegisterWEBPImage(void),
152+ RegisterHEIFImage(void),
152153 RegisterWMFImage(void),
153154 RegisterWPGImage(void),
154155 RegisterXImage(void),
@@ -294,6 +295,7 @@
294295 UnregisterVSTImage(void),
295296 UnregisterWBMPImage(void),
296297 UnregisterWEBPImage(void),
298+ UnregisterHEIFImage(void),
297299 UnregisterWMFImage(void),
298300 UnregisterWPGImage(void),
299301 UnregisterXImage(void),
diff -r b067afcd6aa7 -r 1aece932bb29 magick/symbols.h
--- a/magick/symbols.h Fri Jan 14 15:01:00 2022 -0600
+++ b/magick/symbols.h Fri Jan 14 18:08:18 2022 -0600
@@ -817,6 +817,7 @@
817817 #define RegisterGIFImage GmRegisterGIFImage
818818 #define RegisterGRADIENTImage GmRegisterGRADIENTImage
819819 #define RegisterGRAYImage GmRegisterGRAYImage
820+#define RegisterHEIFImage GmRegisterHEIFImage
820821 #define RegisterHISTOGRAMImage GmRegisterHISTOGRAMImage
821822 #define RegisterHRZImage GmRegisterHRZImage
822823 #define RegisterHTMLImage GmRegisterHTMLImage
@@ -1041,6 +1042,7 @@
10411042 #define UnregisterGIFImage GmUnregisterGIFImage
10421043 #define UnregisterGRADIENTImage GmUnregisterGRADIENTImage
10431044 #define UnregisterGRAYImage GmUnregisterGRAYImage
1045+#define UnregisterHEIFImage GmUnregisterHEIFImage
10441046 #define UnregisterHISTOGRAMImage GmUnregisterHISTOGRAMImage
10451047 #define UnregisterHRZImage GmUnregisterHRZImage
10461048 #define UnregisterHTMLImage GmUnregisterHTMLImage
diff -r b067afcd6aa7 -r 1aece932bb29 www/Changelog.html
--- a/www/Changelog.html Fri Jan 14 15:01:00 2022 -0600
+++ b/www/Changelog.html Fri Jan 14 18:08:18 2022 -0600
@@ -37,10 +37,13 @@
3737
3838 <p>2022-01-14 Bob Friesenhahn &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
3939 <blockquote>
40-* magick/blob.c (ReadBlobStream): Fix EOF logic similar to
40+<p>* coders/heif.c: HEIF reader written by Tobias Mark. From
41+SourceForge Code Merge Request #15: &quot;Added minimal heif support&quot;.</p>
42+<p>* magick/blob.c (ReadBlobStream): Fix EOF logic similar to
4143 ReadBlob. Addresses oss-fuzz 43617
4244 &quot;graphicsmagick:coder_P7_fuzzer: Use-of-uninitialized-value in
43-WritePNMImage&quot;.</blockquote>
45+WritePNMImage&quot;.</p>
46+</blockquote>
4447 <p>2022-01-12 Bob Friesenhahn &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
4548 <blockquote>
4649 <p>* magick/blob.c (ReadBlob): Fix EOF logic. Addresses oss-fuzz
diff -r b067afcd6aa7 -r 1aece932bb29 www/README.html
--- a/www/README.html Fri Jan 14 15:01:00 2022 -0600
+++ b/www/README.html Fri Jan 14 18:08:18 2022 -0600
@@ -404,6 +404,12 @@
404404 libdeflate.</p>
405405 </blockquote>
406406 </li>
407+<li><p class="first">GraphicsMagick requires the heif library from</p>
408+<blockquote>
409+<p><a class="reference external" href="https://github.com/strukturag/libheif">https://github.com/strukturag/libheif</a></p>
410+<p>to read heif/heic files.</p>
411+</blockquote>
412+</li>
407413 </ul>
408414 </div>
409415 </div>
Afficher sur ancien navigateur de dépôt.