• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Revisionde5b3c1ea7278b4bc51f3ec123bd6bf672ca3dae (tree)
Time2021-05-25 23:01:57
AuthorTobias <tbsmark86@gmai...>
CommiterTobias

Log Message

Added jpeg-xl/jxl decoder (no encoder yet)

Change Summary

Incremental Difference

diff -r 48c9416cca66 -r de5b3c1ea727 Makefile.in
--- a/Makefile.in Mon May 10 11:16:24 2021 -0500
+++ b/Makefile.in Tue May 25 16:01:57 2021 +0200
@@ -604,6 +604,14 @@
604604 $@
605605 @HasJPEG_TRUE@@WITH_MODULES_TRUE@am_coders_jpeg_la_rpath = -rpath \
606606 @HasJPEG_TRUE@@WITH_MODULES_TRUE@ $(codersdir)
607+coders_jxl_la_DEPENDENCIES = $(LIBMAGICK) $(am__DEPENDENCIES_1)
608+am_coders_jxl_la_OBJECTS = coders/jxl_la-jxl.lo
609+coders_jxl_la_OBJECTS = $(am_coders_jxl_la_OBJECTS)
610+coders_jxl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
611+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
612+ $(coders_jxl_la_LDFLAGS) $(LDFLAGS) -o $@
613+@HasJXL_TRUE@@WITH_MODULES_TRUE@am_coders_jxl_la_rpath = -rpath \
614+@HasJXL_TRUE@@WITH_MODULES_TRUE@ $(codersdir)
607615 coders_label_la_DEPENDENCIES = $(LIBMAGICK)
608616 am_coders_label_la_OBJECTS = coders/label_la-label.lo
609617 coders_label_la_OBJECTS = $(am_coders_label_la_OBJECTS)
@@ -1218,8 +1226,8 @@
12181226 coders/xc.c coders/xcf.c coders/xpm.c coders/yuv.c \
12191227 coders/psd.c coders/dps.c coders/clipboard.c coders/emf.c \
12201228 coders/fpx.c coders/jbig.c coders/jnx.c coders/jpeg.c \
1221- coders/jp2.c coders/ept.c coders/tiff.c coders/x.c \
1222- coders/xwd.c coders/webp.c filters/analyze.c
1229+ coders/jxl.c coders/jp2.c coders/ept.c coders/tiff.c \
1230+ coders/x.c coders/xwd.c coders/webp.c filters/analyze.c
12231231 @HasX11_TRUE@am__objects_1 = magick/libGraphicsMagick_la-animate.lo \
12241232 @HasX11_TRUE@ magick/libGraphicsMagick_la-display.lo \
12251233 @HasX11_TRUE@ magick/libGraphicsMagick_la-PreRvIcccm.lo \
@@ -1316,16 +1324,18 @@
13161324 @HasJPEG_TRUE@am__objects_10 = \
13171325 @HasJPEG_TRUE@ coders/magick_libGraphicsMagick_la-jnx.lo \
13181326 @HasJPEG_TRUE@ coders/magick_libGraphicsMagick_la-jpeg.lo
1319-@HasJP2_TRUE@am__objects_11 = \
1327+@HasJXL_TRUE@am__objects_11 = \
1328+@HasJXL_TRUE@ coders/magick_libGraphicsMagick_la-jxl.lo
1329+@HasJP2_TRUE@am__objects_12 = \
13201330 @HasJP2_TRUE@ coders/magick_libGraphicsMagick_la-jp2.lo
1321-@HasTIFF_TRUE@am__objects_12 = \
1331+@HasTIFF_TRUE@am__objects_13 = \
13221332 @HasTIFF_TRUE@ coders/magick_libGraphicsMagick_la-ept.lo \
13231333 @HasTIFF_TRUE@ coders/magick_libGraphicsMagick_la-tiff.lo
1324-@HasX11_TRUE@am__objects_13 = coders/magick_libGraphicsMagick_la-x.lo \
1334+@HasX11_TRUE@am__objects_14 = coders/magick_libGraphicsMagick_la-x.lo \
13251335 @HasX11_TRUE@ coders/magick_libGraphicsMagick_la-xwd.lo
1326-@HasWEBP_TRUE@am__objects_14 = \
1336+@HasWEBP_TRUE@am__objects_15 = \
13271337 @HasWEBP_TRUE@ coders/magick_libGraphicsMagick_la-webp.lo
1328-am__objects_15 = $(am__objects_4) \
1338+am__objects_16 = $(am__objects_4) \
13291339 coders/magick_libGraphicsMagick_la-art.lo \
13301340 coders/magick_libGraphicsMagick_la-avs.lo \
13311341 coders/magick_libGraphicsMagick_la-bmp.lo \
@@ -1414,11 +1424,12 @@
14141424 coders/magick_libGraphicsMagick_la-yuv.lo $(am__objects_5) \
14151425 $(am__objects_6) $(am__objects_7) $(am__objects_8) \
14161426 $(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
1427+ $(am__objects_12) $(am__objects_13) $(am__objects_14) \
1428+ $(am__objects_15)
1429+am__objects_17 = filters/magick_libGraphicsMagick_la-analyze.lo
14191430 @WITH_MODULES_FALSE@am_magick_libGraphicsMagick_la_OBJECTS = \
14201431 @WITH_MODULES_FALSE@ $(am__objects_2) $(am__objects_3) \
1421-@WITH_MODULES_FALSE@ $(am__objects_15) $(am__objects_16)
1432+@WITH_MODULES_FALSE@ $(am__objects_16) $(am__objects_17)
14221433 @WITH_MODULES_TRUE@am_magick_libGraphicsMagick_la_OBJECTS = \
14231434 @WITH_MODULES_TRUE@ $(am__objects_2) $(am__objects_3)
14241435 magick_libGraphicsMagick_la_OBJECTS = \
@@ -1429,11 +1440,11 @@
14291440 $(LDFLAGS) -o $@
14301441 wand_libGraphicsMagickWand_la_DEPENDENCIES = $(LIBMAGICK) \
14311442 $(am__DEPENDENCIES_1)
1432-am__objects_17 = wand/libGraphicsMagickWand_la-drawing_wand.lo \
1443+am__objects_18 = wand/libGraphicsMagickWand_la-drawing_wand.lo \
14331444 wand/libGraphicsMagickWand_la-magick_compat.lo \
14341445 wand/libGraphicsMagickWand_la-magick_wand.lo \
14351446 wand/libGraphicsMagickWand_la-pixel_wand.lo
1436-am_wand_libGraphicsMagickWand_la_OBJECTS = $(am__objects_17)
1447+am_wand_libGraphicsMagickWand_la_OBJECTS = $(am__objects_18)
14371448 wand_libGraphicsMagickWand_la_OBJECTS = \
14381449 $(am_wand_libGraphicsMagickWand_la_OBJECTS)
14391450 wand_libGraphicsMagickWand_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@@ -1654,6 +1665,7 @@
16541665 coders/$(DEPDIR)/jnx_la-jnx.Plo \
16551666 coders/$(DEPDIR)/jp2_la-jp2.Plo \
16561667 coders/$(DEPDIR)/jpeg_la-jpeg.Plo \
1668+ coders/$(DEPDIR)/jxl_la-jxl.Plo \
16571669 coders/$(DEPDIR)/label_la-label.Plo \
16581670 coders/$(DEPDIR)/locale_la-locale.Plo \
16591671 coders/$(DEPDIR)/logo_la-logo.Plo \
@@ -1691,6 +1703,7 @@
16911703 coders/$(DEPDIR)/magick_libGraphicsMagick_la-jnx.Plo \
16921704 coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Plo \
16931705 coders/$(DEPDIR)/magick_libGraphicsMagick_la-jpeg.Plo \
1706+ coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Plo \
16941707 coders/$(DEPDIR)/magick_libGraphicsMagick_la-label.Plo \
16951708 coders/$(DEPDIR)/magick_libGraphicsMagick_la-locale.Plo \
16961709 coders/$(DEPDIR)/magick_libGraphicsMagick_la-logo.Plo \
@@ -1970,41 +1983,42 @@
19701983 $(coders_icon_la_SOURCES) $(coders_identity_la_SOURCES) \
19711984 $(coders_info_la_SOURCES) $(coders_jbig_la_SOURCES) \
19721985 $(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) \
1986+ $(coders_jpeg_la_SOURCES) $(coders_jxl_la_SOURCES) \
1987+ $(coders_label_la_SOURCES) $(coders_locale_la_SOURCES) \
1988+ $(coders_logo_la_SOURCES) $(coders_mac_la_SOURCES) \
1989+ $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \
1990+ $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \
1991+ $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \
1992+ $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \
1993+ $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \
1994+ $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \
1995+ $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \
1996+ $(coders_palm_la_SOURCES) $(coders_pcd_la_SOURCES) \
1997+ $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \
1998+ $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \
1999+ $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \
2000+ $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \
2001+ $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \
2002+ $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \
2003+ $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \
2004+ $(coders_pwp_la_SOURCES) $(coders_rgb_la_SOURCES) \
2005+ $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \
2006+ $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \
2007+ $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \
2008+ $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \
2009+ $(coders_tga_la_SOURCES) $(coders_tiff_la_SOURCES) \
2010+ $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \
2011+ $(coders_topol_la_SOURCES) $(coders_ttf_la_SOURCES) \
2012+ $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \
2013+ $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \
2014+ $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \
2015+ $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \
2016+ $(coders_webp_la_SOURCES) $(coders_wmf_la_SOURCES) \
2017+ $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \
2018+ $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \
2019+ $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \
2020+ $(coders_xwd_la_SOURCES) $(coders_yuv_la_SOURCES) \
2021+ $(filters_analyze_la_SOURCES) \
20082022 $(magick_libGraphicsMagick_la_SOURCES) \
20092023 $(wand_libGraphicsMagickWand_la_SOURCES) \
20102024 $(Magick___demo_analyze_SOURCES) \
@@ -2047,41 +2061,42 @@
20472061 $(coders_icon_la_SOURCES) $(coders_identity_la_SOURCES) \
20482062 $(coders_info_la_SOURCES) $(coders_jbig_la_SOURCES) \
20492063 $(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) \
2064+ $(coders_jpeg_la_SOURCES) $(coders_jxl_la_SOURCES) \
2065+ $(coders_label_la_SOURCES) $(coders_locale_la_SOURCES) \
2066+ $(coders_logo_la_SOURCES) $(coders_mac_la_SOURCES) \
2067+ $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \
2068+ $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \
2069+ $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \
2070+ $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \
2071+ $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \
2072+ $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \
2073+ $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \
2074+ $(coders_palm_la_SOURCES) $(coders_pcd_la_SOURCES) \
2075+ $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \
2076+ $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \
2077+ $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \
2078+ $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \
2079+ $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \
2080+ $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \
2081+ $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \
2082+ $(coders_pwp_la_SOURCES) $(coders_rgb_la_SOURCES) \
2083+ $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \
2084+ $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \
2085+ $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \
2086+ $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \
2087+ $(coders_tga_la_SOURCES) $(coders_tiff_la_SOURCES) \
2088+ $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \
2089+ $(coders_topol_la_SOURCES) $(coders_ttf_la_SOURCES) \
2090+ $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \
2091+ $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \
2092+ $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \
2093+ $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \
2094+ $(coders_webp_la_SOURCES) $(coders_wmf_la_SOURCES) \
2095+ $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \
2096+ $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \
2097+ $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \
2098+ $(coders_xwd_la_SOURCES) $(coders_yuv_la_SOURCES) \
2099+ $(filters_analyze_la_SOURCES) \
20852100 $(am__magick_libGraphicsMagick_la_SOURCES_DIST) \
20862101 $(wand_libGraphicsMagickWand_la_SOURCES) \
20872102 $(Magick___demo_analyze_SOURCES) \
@@ -2487,6 +2502,7 @@
24872502 LIB_JBIG = @LIB_JBIG@
24882503 LIB_JP2 = @LIB_JP2@
24892504 LIB_JPEG = @LIB_JPEG@
2505+LIB_JXL = @LIB_JXL@
24902506 LIB_LCMS = @LIB_LCMS@
24912507 LIB_LZMA = @LIB_LZMA@
24922508 LIB_MATH = @LIB_MATH@
@@ -2857,6 +2873,8 @@
28572873 @HasJBIG_TRUE@MAGICK_JBIG_SRCS = coders/jbig.c
28582874 @HasJPEG_TRUE@MAGICK_JPEG_MODULES = coders/jnx.la coders/jpeg.la
28592875 @HasJPEG_TRUE@MAGICK_JPEG_SRCS = coders/jnx.c coders/jpeg.c
2876+@HasJXL_TRUE@MAGICK_JXL_MODULES = coders/jxl.la
2877+@HasJXL_TRUE@MAGICK_JXL_SRCS = coders/jxl.c
28602878 @HasJP2_TRUE@MAGICK_JP2_MODULES = coders/jp2.la
28612879 @HasJP2_TRUE@MAGICK_JP2_SRCS = coders/jp2.c
28622880 @HasPNG_TRUE@MAGICK_PNG_MODULES = coders/png.la
@@ -2967,6 +2985,7 @@
29672985 $(MAGICK_FPX_SRCS) \
29682986 $(MAGICK_JBIG_SRCS) \
29692987 $(MAGICK_JPEG_SRCS) \
2988+ $(MAGICK_JXL_SRCS) \
29702989 $(MAGICK_JP2_SRCS) \
29712990 $(MAGICK_TIFF_SRCS) \
29722991 $(MAGICK_X11_CODER_SRCS) \
@@ -3064,7 +3083,7 @@
30643083 @WITH_MODULES_TRUE@ $(MAGICK_DPS_MODULES) $(MAGICK_FPX_MODULES) $(MAGICK_GDI32_MODULES) \
30653084 @WITH_MODULES_TRUE@ $(MAGICK_JBIG_MODULES) $(MAGICK_JPEG_MODULES) $(MAGICK_JP2_MODULES) \
30663085 @WITH_MODULES_TRUE@ $(MAGICK_PNG_MODULES) $(MAGICK_TIFF_MODULES) $(MAGICK_X11_CODER_MODULES) \
3067-@WITH_MODULES_TRUE@ $(MAGICK_WEBP_MODULES)
3086+@WITH_MODULES_TRUE@ $(MAGICK_WEBP_MODULES) $(MAGICK_JXL_MODULES)
30683087
30693088
30703089 # ART coder module
@@ -3265,6 +3284,12 @@
32653284 coders_jp2_la_LDFLAGS = $(MODULECOMMONFLAGS)
32663285 coders_jp2_la_LIBADD = $(LIBMAGICK) $(LIB_JP2) $(LIB_JPEG) $(LIB_MATH)
32673286
3287+# JXL coder module
3288+coders_jxl_la_SOURCES = coders/jxl.c
3289+coders_jxl_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
3290+coders_jxl_la_LDFLAGS = $(MODULECOMMONFLAGS)
3291+coders_jxl_la_LIBADD = $(LIBMAGICK) $(LIB_JXL)
3292+
32683293 # LABEL coder module
32693294 coders_label_la_SOURCES = coders/label.c
32703295 coders_label_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
@@ -5382,6 +5407,11 @@
53825407
53835408 coders/jpeg.la: $(coders_jpeg_la_OBJECTS) $(coders_jpeg_la_DEPENDENCIES) $(EXTRA_coders_jpeg_la_DEPENDENCIES) coders/$(am__dirstamp)
53845409 $(AM_V_CCLD)$(coders_jpeg_la_LINK) $(am_coders_jpeg_la_rpath) $(coders_jpeg_la_OBJECTS) $(coders_jpeg_la_LIBADD) $(LIBS)
5410+coders/jxl_la-jxl.lo: coders/$(am__dirstamp) \
5411+ coders/$(DEPDIR)/$(am__dirstamp)
5412+
5413+coders/jxl.la: $(coders_jxl_la_OBJECTS) $(coders_jxl_la_DEPENDENCIES) $(EXTRA_coders_jxl_la_DEPENDENCIES) coders/$(am__dirstamp)
5414+ $(AM_V_CCLD)$(coders_jxl_la_LINK) $(am_coders_jxl_la_rpath) $(coders_jxl_la_OBJECTS) $(coders_jxl_la_LIBADD) $(LIBS)
53855415 coders/label_la-label.lo: coders/$(am__dirstamp) \
53865416 coders/$(DEPDIR)/$(am__dirstamp)
53875417
@@ -6091,6 +6121,8 @@
60916121 coders/$(DEPDIR)/$(am__dirstamp)
60926122 coders/magick_libGraphicsMagick_la-jpeg.lo: coders/$(am__dirstamp) \
60936123 coders/$(DEPDIR)/$(am__dirstamp)
6124+coders/magick_libGraphicsMagick_la-jxl.lo: coders/$(am__dirstamp) \
6125+ coders/$(DEPDIR)/$(am__dirstamp)
60946126 coders/magick_libGraphicsMagick_la-jp2.lo: coders/$(am__dirstamp) \
60956127 coders/$(DEPDIR)/$(am__dirstamp)
60966128 coders/magick_libGraphicsMagick_la-ept.lo: coders/$(am__dirstamp) \
@@ -6469,6 +6501,7 @@
64696501 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/jnx_la-jnx.Plo@am__quote@ # am--include-marker
64706502 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/jp2_la-jp2.Plo@am__quote@ # am--include-marker
64716503 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/jpeg_la-jpeg.Plo@am__quote@ # am--include-marker
6504+@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/jxl_la-jxl.Plo@am__quote@ # am--include-marker
64726505 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/label_la-label.Plo@am__quote@ # am--include-marker
64736506 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/locale_la-locale.Plo@am__quote@ # am--include-marker
64746507 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/logo_la-logo.Plo@am__quote@ # am--include-marker
@@ -6506,6 +6539,7 @@
65066539 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-jnx.Plo@am__quote@ # am--include-marker
65076540 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Plo@am__quote@ # am--include-marker
65086541 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-jpeg.Plo@am__quote@ # am--include-marker
6542+@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Plo@am__quote@ # am--include-marker
65096543 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-label.Plo@am__quote@ # am--include-marker
65106544 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-locale.Plo@am__quote@ # am--include-marker
65116545 @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libGraphicsMagick_la-logo.Plo@am__quote@ # am--include-marker
@@ -6989,6 +7023,13 @@
69897023 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
69907024 @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_jpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/jpeg_la-jpeg.lo `test -f 'coders/jpeg.c' || echo '$(srcdir)/'`coders/jpeg.c
69917025
7026+coders/jxl_la-jxl.lo: coders/jxl.c
7027+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_jxl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/jxl_la-jxl.lo -MD -MP -MF coders/$(DEPDIR)/jxl_la-jxl.Tpo -c -o coders/jxl_la-jxl.lo `test -f 'coders/jxl.c' || echo '$(srcdir)/'`coders/jxl.c
7028+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/jxl_la-jxl.Tpo coders/$(DEPDIR)/jxl_la-jxl.Plo
7029+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='coders/jxl.c' object='coders/jxl_la-jxl.lo' libtool=yes @AMDEPBACKSLASH@
7030+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7031+@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_jxl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/jxl_la-jxl.lo `test -f 'coders/jxl.c' || echo '$(srcdir)/'`coders/jxl.c
7032+
69927033 coders/label_la-label.lo: coders/label.c
69937034 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_label_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/label_la-label.lo -MD -MP -MF coders/$(DEPDIR)/label_la-label.Tpo -c -o coders/label_la-label.lo `test -f 'coders/label.c' || echo '$(srcdir)/'`coders/label.c
69947035 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/label_la-label.Tpo coders/$(DEPDIR)/label_la-label.Plo
@@ -8704,6 +8745,13 @@
87048745 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
87058746 @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-jpeg.lo `test -f 'coders/jpeg.c' || echo '$(srcdir)/'`coders/jpeg.c
87068747
8748+coders/magick_libGraphicsMagick_la-jxl.lo: coders/jxl.c
8749+@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-jxl.lo -MD -MP -MF coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Tpo -c -o coders/magick_libGraphicsMagick_la-jxl.lo `test -f 'coders/jxl.c' || echo '$(srcdir)/'`coders/jxl.c
8750+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Tpo coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Plo
8751+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='coders/jxl.c' object='coders/magick_libGraphicsMagick_la-jxl.lo' libtool=yes @AMDEPBACKSLASH@
8752+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
8753+@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-jxl.lo `test -f 'coders/jxl.c' || echo '$(srcdir)/'`coders/jxl.c
8754+
87078755 coders/magick_libGraphicsMagick_la-jp2.lo: coders/jp2.c
87088756 @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-jp2.lo -MD -MP -MF coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Tpo -c -o coders/magick_libGraphicsMagick_la-jp2.lo `test -f 'coders/jp2.c' || echo '$(srcdir)/'`coders/jp2.c
87098757 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Tpo coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Plo
@@ -10204,6 +10252,7 @@
1020410252 -rm -f coders/$(DEPDIR)/jnx_la-jnx.Plo
1020510253 -rm -f coders/$(DEPDIR)/jp2_la-jp2.Plo
1020610254 -rm -f coders/$(DEPDIR)/jpeg_la-jpeg.Plo
10255+ -rm -f coders/$(DEPDIR)/jxl_la-jxl.Plo
1020710256 -rm -f coders/$(DEPDIR)/label_la-label.Plo
1020810257 -rm -f coders/$(DEPDIR)/locale_la-locale.Plo
1020910258 -rm -f coders/$(DEPDIR)/logo_la-logo.Plo
@@ -10241,6 +10290,7 @@
1024110290 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jnx.Plo
1024210291 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Plo
1024310292 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jpeg.Plo
10293+ -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Plo
1024410294 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-label.Plo
1024510295 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-locale.Plo
1024610296 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-logo.Plo
@@ -10592,6 +10642,7 @@
1059210642 -rm -f coders/$(DEPDIR)/jnx_la-jnx.Plo
1059310643 -rm -f coders/$(DEPDIR)/jp2_la-jp2.Plo
1059410644 -rm -f coders/$(DEPDIR)/jpeg_la-jpeg.Plo
10645+ -rm -f coders/$(DEPDIR)/jxl_la-jxl.Plo
1059510646 -rm -f coders/$(DEPDIR)/label_la-label.Plo
1059610647 -rm -f coders/$(DEPDIR)/locale_la-locale.Plo
1059710648 -rm -f coders/$(DEPDIR)/logo_la-logo.Plo
@@ -10629,6 +10680,7 @@
1062910680 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jnx.Plo
1063010681 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jp2.Plo
1063110682 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jpeg.Plo
10683+ -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-jxl.Plo
1063210684 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-label.Plo
1063310685 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-locale.Plo
1063410686 -rm -f coders/$(DEPDIR)/magick_libGraphicsMagick_la-logo.Plo
diff -r 48c9416cca66 -r de5b3c1ea727 README.txt
--- a/README.txt Mon May 10 11:16:24 2021 -0500
+++ b/README.txt Tue May 25 16:01:57 2021 +0200
@@ -394,3 +394,9 @@
394394 https://github.com/ebiggers/libdeflate). Linking with this
395395 library may be necessary for builds where libtiff depends on
396396 libdeflate.
397+
398+* GraphicsMagick requires the JPEG-XL library from
399+
400+ https://gitlab.com/wg1/jpeg-xl
401+
402+ to read and write the JPEG-XL image format.
diff -r 48c9416cca66 -r de5b3c1ea727 coders/Makefile.am
--- a/coders/Makefile.am Mon May 10 11:16:24 2021 -0500
+++ b/coders/Makefile.am Tue May 25 16:01:57 2021 +0200
@@ -36,6 +36,11 @@
3636 MAGICK_JPEG_SRCS = coders/jnx.c coders/jpeg.c
3737 endif
3838
39+if HasJXL
40+MAGICK_JXL_MODULES = coders/jxl.la
41+MAGICK_JXL_SRCS = coders/jxl.c
42+endif
43+
3944 if HasJP2
4045 MAGICK_JP2_MODULES = coders/jp2.la
4146 MAGICK_JP2_SRCS = coders/jp2.c
@@ -164,6 +169,7 @@
164169 $(MAGICK_FPX_SRCS) \
165170 $(MAGICK_JBIG_SRCS) \
166171 $(MAGICK_JPEG_SRCS) \
172+ $(MAGICK_JXL_SRCS) \
167173 $(MAGICK_JP2_SRCS) \
168174 $(MAGICK_TIFF_SRCS) \
169175 $(MAGICK_X11_CODER_SRCS) \
@@ -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_JXL_MODULES)
265271 else
266272 coders_LTLIBRARIES =
267273 endif # WITH_MODULES
@@ -464,6 +470,12 @@
464470 coders_jp2_la_LDFLAGS = $(MODULECOMMONFLAGS)
465471 coders_jp2_la_LIBADD = $(LIBMAGICK) $(LIB_JP2) $(LIB_JPEG) $(LIB_MATH)
466472
473+# JXL coder module
474+coders_jxl_la_SOURCES = coders/jxl.c
475+coders_jxl_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
476+coders_jxl_la_LDFLAGS = $(MODULECOMMONFLAGS)
477+coders_jxl_la_LIBADD = $(LIBMAGICK) $(LIB_JXL)
478+
467479 # LABEL coder module
468480 coders_label_la_SOURCES = coders/label.c
469481 coders_label_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
diff -r 48c9416cca66 -r de5b3c1ea727 coders/jxl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coders/jxl.c Tue May 25 16:01:57 2021 +0200
@@ -0,0 +1,531 @@
1+/*
2+% Copyright (C) 2021 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+% J X X L %
12+% J X L %
13+% JJJ X X LLL %
14+% %
15+% Read/Write Google JPEG-XL Image Format. %
16+% %
17+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18+%
19+*/
20+
21+#include "magick/studio.h"
22+#include "magick/blob.h"
23+#include "magick/colormap.h"
24+#include "magick/log.h"
25+#include "magick/constitute.h"
26+#include "magick/magick.h"
27+#include "magick/monitor.h"
28+#include "magick/pixel_cache.h"
29+#include "magick/profile.h"
30+#include "magick/utility.h"
31+#include "magick/resource.h"
32+
33+
34+#if defined(HasJXL)
35+#include <jxl/decode.h>
36+#include <jxl/encode.h>
37+#include <jxl/thread_parallel_runner.h>
38+
39+#define MaxBufferExtent 16384
40+
41+struct MyJXLMemoryManager {
42+ JxlMemoryManager super;
43+ ExceptionInfo *exception;
44+ const char *filename;
45+};
46+
47+static void *MyJXLMalloc(void *opaque, size_t size)
48+{
49+ unsigned char
50+ *data=MagickAllocateResourceLimitedMemory(unsigned char *,size);
51+ if (data == (unsigned char *) NULL)
52+ {
53+ struct MyJXLMemoryManager
54+ *mm = (struct MyJXLMemoryManager*)opaque;
55+ ThrowException(mm->exception, ResourceLimitError,MemoryAllocationFailed,
56+ mm->filename);
57+ }
58+ return data;
59+}
60+
61+static void MyJXLFree(void *dummy, void *address)
62+{
63+ (void)(dummy);
64+ MagickFreeResourceLimitedMemory(address);
65+}
66+
67+static void MyJxlMemoryManagerInit(struct MyJXLMemoryManager *mm,
68+ Image *image,ExceptionInfo *exception)
69+{
70+ mm->exception=exception;
71+ mm->filename=image->filename;
72+ mm->super.opaque=mm;
73+ mm->super.alloc=MyJXLMalloc;
74+ mm->super.free=MyJXLFree;
75+}
76+
77+/*
78+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79+% %
80+% %
81+% %
82+% R e a d J X L I m a g e %
83+% %
84+% %
85+% %
86+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87+%
88+% ReadJXLImage() reads an image in the JXL image format.
89+%
90+% The format of the ReadJXLImage method is:
91+%
92+% Image *ReadJXLImage(const ImageInfo *image_info,
93+% ExceptionInfo *exception)
94+%
95+% A description of each parameter follows:
96+%
97+% o image_info: the image info.
98+%
99+% o exception: return any errors or warnings in this structure.
100+%
101+*/
102+static inline OrientationType convert_orientation(JxlOrientation orientation)
103+{
104+ switch (orientation)
105+ {
106+ default:
107+ case JXL_ORIENT_IDENTITY:
108+ return TopLeftOrientation;
109+ case JXL_ORIENT_FLIP_HORIZONTAL:
110+ return TopRightOrientation;
111+ case JXL_ORIENT_ROTATE_180:
112+ return BottomRightOrientation;
113+ case JXL_ORIENT_FLIP_VERTICAL:
114+ return BottomLeftOrientation;
115+ case JXL_ORIENT_TRANSPOSE:
116+ return LeftTopOrientation;
117+ case JXL_ORIENT_ROTATE_90_CW:
118+ return RightTopOrientation;
119+ case JXL_ORIENT_ANTI_TRANSPOSE:
120+ return RightBottomOrientation;
121+ case JXL_ORIENT_ROTATE_90_CCW:
122+ return LeftBottomOrientation;
123+ }
124+}
125+
126+#define FOR_PIXEL_PACKETS \
127+ for (y=0; y < (size_t) image->rows; y++) \
128+ { \
129+ q=SetImagePixelsEx(image,0,y,image->columns,1,exception); \
130+ if (q == (PixelPacket *) NULL) \
131+ return MagickFail; \
132+ for (x=0; x < (size_t) image->columns; x++)
133+#define END_FOR_PIXEL_PACKETS \
134+ if (!SyncImagePixels(image)) \
135+ return MagickFail; \
136+ } \
137+
138+static MagickBool fill_pixels_char(Image *image, ExceptionInfo *exception,
139+ unsigned char *p)
140+{
141+ size_t
142+ x,
143+ y;
144+
145+ PixelPacket
146+ *q;
147+
148+ if (image->matte) {
149+ FOR_PIXEL_PACKETS
150+ {
151+ SetRedSample(q,ScaleCharToQuantum(*p++));
152+ SetGreenSample(q,ScaleCharToQuantum(*p++));
153+ SetBlueSample(q,ScaleCharToQuantum(*p++));
154+ SetOpacitySample(q,MaxRGB-ScaleCharToQuantum(*p++));
155+ q++;
156+ }
157+ END_FOR_PIXEL_PACKETS
158+ } else {
159+ FOR_PIXEL_PACKETS
160+ {
161+ SetRedSample(q,ScaleCharToQuantum(*p++));
162+ SetGreenSample(q,ScaleCharToQuantum(*p++));
163+ SetBlueSample(q,ScaleCharToQuantum(*p++));
164+ SetOpacitySample(q,OpaqueOpacity);
165+ q++;
166+ }
167+ END_FOR_PIXEL_PACKETS
168+ }
169+
170+ return MagickTrue;
171+}
172+
173+static MagickBool fill_pixels_float(Image *image, ExceptionInfo *exception,
174+ float *p)
175+{
176+ size_t
177+ x,
178+ y;
179+
180+ PixelPacket
181+ *q;
182+
183+ if (image->matte) {
184+ FOR_PIXEL_PACKETS
185+ {
186+ SetRedSample(q,RoundDoubleToQuantum(*p++));
187+ SetGreenSample(q,RoundDoubleToQuantum(*p++));
188+ SetBlueSample(q,RoundDoubleToQuantum(*p++));
189+ SetOpacitySample(q,MaxRGB-RoundDoubleToQuantum(*p++));
190+ q++;
191+ }
192+ END_FOR_PIXEL_PACKETS
193+ } else {
194+ FOR_PIXEL_PACKETS
195+ {
196+ SetRedSample(q,ScaleCharToQuantum(*p++));
197+ SetGreenSample(q,ScaleCharToQuantum(*p++));
198+ SetBlueSample(q,ScaleCharToQuantum(*p++));
199+ SetOpacitySample(q,OpaqueOpacity);
200+ q++;
201+ }
202+ END_FOR_PIXEL_PACKETS
203+ }
204+
205+ return MagickTrue;
206+}
207+
208+#define JXLReadCleanup() \
209+ if(jxl_thread_runner) JxlThreadParallelRunnerDestroy(jxl_thread_runner); \
210+ if(jxl) JxlDecoderDestroy(jxl); \
211+ if(in_buf) MagickFreeResourceLimitedMemory(in_buf); \
212+ if(out_buf) MagickFreeResourceLimitedMemory(out_buf); \
213+
214+
215+#define ThrowJXLReaderException(code_,reason_,image_) \
216+{ \
217+ JXLReadCleanup() \
218+ ThrowReaderException(code_,reason_,image_); \
219+}
220+
221+static Image *ReadJXLImage(const ImageInfo *image_info,
222+ ExceptionInfo *exception)
223+{
224+ Image
225+ *image;
226+
227+ JxlDecoder
228+ *jxl = NULL;
229+
230+ void
231+ *jxl_thread_runner = NULL;
232+
233+ JxlDecoderStatus
234+ status;
235+
236+ JxlPixelFormat
237+ format;
238+
239+ struct MyJXLMemoryManager
240+ mm;
241+
242+ size_t
243+ in_len = MaxBufferExtent;
244+
245+ unsigned char
246+ *in_buf = NULL,
247+ *out_buf = NULL;
248+
249+ assert(image_info != (const ImageInfo *) NULL);
250+ assert(image_info->signature == MagickSignature);
251+ assert(exception != (ExceptionInfo *) NULL);
252+ assert(exception->signature == MagickSignature);
253+
254+ /*
255+ Open image file.
256+ */
257+ image=AllocateImage(image_info);
258+ if (image == (Image *) NULL)
259+ ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
260+
261+ if (OpenBlob(image_info,image,ReadBinaryBlobMode,exception) == MagickFail)
262+ ThrowReaderException(FileOpenError,UnableToOpenFile,image);
263+
264+ /* Init JXL-Decoder handles */
265+ MyJxlMemoryManagerInit(&mm,image,exception);
266+ jxl=JxlDecoderCreate(&mm.super);
267+ if (jxl == (JxlDecoder *) NULL)
268+ ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
269+
270+ /* Deliver image as-is. We provide autoOrient function if user requires it */
271+ if (JxlDecoderSetKeepOrientation(jxl, JXL_TRUE) != JXL_DEC_SUCCESS)
272+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
273+
274+ jxl_thread_runner=JxlThreadParallelRunnerCreate(NULL,(size_t) GetMagickResourceLimit(
275+ ThreadsResource));
276+ if (jxl_thread_runner == (void *) NULL)
277+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
278+ if (JxlDecoderSetParallelRunner(jxl, JxlThreadParallelRunner, jxl_thread_runner)
279+ != JXL_DEC_SUCCESS)
280+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
281+
282+ /* TODO: Useful value might be JXL_DEC_COLOR_ENCODING to get the ICC profile */
283+ if (JxlDecoderSubscribeEvents(jxl,
284+ (JxlDecoderStatus)(image_info->ping == MagickTrue
285+ ? JXL_DEC_BASIC_INFO
286+ : JXL_DEC_BASIC_INFO | JXL_DEC_FULL_IMAGE)
287+ ) != JXL_DEC_SUCCESS)
288+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
289+
290+
291+ in_buf=MagickAllocateResourceLimitedArray(unsigned char *,in_len,sizeof(*in_buf));
292+ if (in_buf == (unsigned char *) NULL)
293+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
294+
295+ status=JXL_DEC_NEED_MORE_INPUT;
296+ while (status != JXL_DEC_ERROR && status != JXL_DEC_SUCCESS)
297+ {
298+ switch (status)
299+ {
300+ case JXL_DEC_NEED_MORE_INPUT:
301+ { /* read something from blob */
302+ size_t
303+ remaining = JxlDecoderReleaseInput(jxl),
304+ count;
305+
306+ if (remaining > 0)
307+ memmove(in_buf,in_buf+in_len-remaining,remaining);
308+ count=ReadBlob(image,in_len-remaining,in_buf+remaining);
309+ if (count <= 0)
310+ ThrowJXLReaderException(CorruptImageError, UnexpectedEndOfFile, image);
311+ status = JxlDecoderSetInput(jxl,(const uint8_t *) in_buf, (size_t) count);
312+ break;
313+ }
314+ case JXL_DEC_BASIC_INFO:
315+ { /* got image information */
316+ JxlBasicInfo
317+ basic_info;
318+
319+ status=JxlDecoderGetBasicInfo(jxl,&basic_info);
320+ if (status != JXL_DEC_SUCCESS)
321+ break;
322+
323+ if (basic_info.have_animation == 1)
324+ ThrowJXLReaderException(CoderError, ImageTypeNotSupported, image);
325+ /* validate expected channels in particular Grayscale not supported */
326+ if (basic_info.num_color_channels != 3)
327+ ThrowJXLReaderException(CoderError, ImageTypeNotSupported, image);
328+
329+ image->columns=basic_info.xsize;
330+ image->rows=basic_info.ysize;
331+ image->depth=basic_info.bits_per_sample;
332+ if (basic_info.alpha_bits != 0)
333+ image->matte=MagickTrue;
334+
335+ image->orientation=convert_orientation(basic_info.orientation);
336+
337+ memset(&format,0,sizeof(format));
338+ format.endianness = JXL_NATIVE_ENDIAN;
339+ format.num_channels=image->matte ? 4 : 3;
340+ format.data_type=(image->depth > 8) ? JXL_TYPE_FLOAT : JXL_TYPE_UINT8;
341+ break;
342+ }
343+
344+ case JXL_DEC_NEED_IMAGE_OUT_BUFFER:
345+ { /* allocate output buffer */
346+ size_t
347+ out_len;
348+
349+ status=JxlDecoderImageOutBufferSize(jxl,&format,&out_len);
350+ if (status != JXL_DEC_SUCCESS)
351+ break;
352+
353+ out_buf=MagickAllocateResourceLimitedArray(unsigned char *,out_len,sizeof(*in_buf));
354+ if (out_buf == (unsigned char *) NULL)
355+ ThrowJXLReaderException(ResourceLimitError,MemoryAllocationFailed,image);
356+
357+ status=JxlDecoderSetImageOutBuffer(jxl,&format,out_buf,out_len);
358+ break;
359+ }
360+ case JXL_DEC_FULL_IMAGE:
361+ { /* got image */
362+ assert(out_buf != (unsigned char *)NULL);
363+ if (format.data_type == JXL_TYPE_UINT8) {
364+ if (fill_pixels_char(image, exception, out_buf) == MagickFail) {
365+ status = JXL_DEC_ERROR;
366+ }
367+ } else {
368+ if (fill_pixels_float(image, exception, (float*)out_buf) == MagickFail) {
369+ status = JXL_DEC_ERROR;
370+ }
371+ }
372+ break;
373+ }
374+ default:
375+ /* unexpected status is error.
376+ * - JXL_DEC_SUCCESS should never happen here so it's also an error
377+ */
378+ status=JXL_DEC_ERROR;
379+ break;
380+ }
381+ if (status == JXL_DEC_ERROR)
382+ break;
383+ status = JxlDecoderProcessInput(jxl);
384+ }
385+ /* every break outside of success is some kind of error */
386+ if(status != JXL_DEC_SUCCESS) {
387+ /* no details available */
388+ ThrowReaderException(CorruptImageError, AnErrorHasOccurredReadingFromFile, image);
389+ }
390+
391+ JXLReadCleanup()
392+ CloseBlob(image);
393+ return image;
394+}
395+
396+/*
397+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398+% %
399+% %
400+% %
401+% W r i t e J X L I m a g e %
402+% %
403+% %
404+% %
405+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
406+%
407+% WriteJXLImage() writes an image in the JXL image format.
408+%
409+% The format of the WriteJXLImage method is:
410+%
411+% MagickPassFail WriteJXLImage(const ImageInfo *image_info, Image *image)
412+%
413+% A description of each parameter follows.
414+%
415+% o image_info: the image info.
416+%
417+% o image: The image.
418+%
419+*/
420+static unsigned int WriteJXLImage(const ImageInfo *image_info,Image *image)
421+{
422+ int
423+ status;
424+
425+ assert(image_info != (const ImageInfo *) NULL);
426+ assert(image_info->signature == MagickSignature);
427+ assert(image != (Image *) NULL);
428+ assert(image->signature == MagickSignature);
429+
430+ /*
431+ Open output image file.
432+ */
433+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
434+ if (status == MagickFail)
435+ ThrowWriterException(FileOpenError,UnableToOpenFile,image);
436+
437+ // TODO
438+
439+ CloseBlob(image);
440+
441+ return MagickPass;
442+}
443+
444+#endif
445+
446+
447+/*
448+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
449+% %
450+% %
451+% %
452+% R e g i s t e r J X L I m a g e %
453+% %
454+% %
455+% %
456+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
457+%
458+% Method RegisterJXLImage adds attributes for the JXL image format to
459+% the list of supported formats. The attributes include the image format
460+% tag, a method to read and/or write the format and a brief
461+% description of the format.
462+%
463+% The format of the RegisterJXLImage method is:
464+%
465+% RegisterJXLImage(void)
466+%
467+*/
468+ModuleExport void RegisterJXLImage(void)
469+{
470+ static const char
471+ description[] = "JXL Image Format";
472+
473+ static char
474+ version[20];
475+
476+ MagickInfo
477+ *entry;
478+
479+ unsigned int
480+ jxl_major,
481+ jxl_minor,
482+ jxl_revision;
483+
484+ *version='\0';
485+
486+ int encoder_version=(JxlDecoderVersion());
487+ jxl_major=(encoder_version >> 16) & 0xff;
488+ jxl_minor=(encoder_version >> 8) & 0xff;
489+ jxl_revision=encoder_version & 0xff;
490+ (void) sprintf(version,
491+ "jxl v%u.%u.%u", jxl_major,
492+ jxl_minor, jxl_revision);
493+
494+ entry=SetMagickInfo("JXL");
495+#if defined(HasJXL)
496+ entry->decoder=(DecoderHandler) ReadJXLImage;
497+ //entry->encoder=(EncoderHandler) WriteJXLImage;
498+#endif
499+ entry->description=description;
500+ entry->adjoin=False;
501+ entry->seekable_stream=MagickTrue;
502+ if (*version != '\0')
503+ entry->version=version;
504+ entry->module="JXL";
505+ entry->coder_class=PrimaryCoderClass;
506+ (void) RegisterMagickInfo(entry);
507+}
508+
509+/*
510+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511+% %
512+% %
513+% %
514+% U n r e g i s t e r J X L I m a g e %
515+% %
516+% %
517+% %
518+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
519+%
520+% Method UnregisterJXLImage removes format registrations made by the
521+% JXL module from the list of supported formats.
522+%
523+% The format of the UnregisterJXLImage method is:
524+%
525+% UnregisterJXLImage(void)
526+%
527+*/
528+ModuleExport void UnregisterJXLImage(void)
529+{
530+ (void) UnregisterMagickInfo("JXL");
531+}
diff -r 48c9416cca66 -r de5b3c1ea727 configure
--- a/configure Mon May 10 11:16:24 2021 -0500
+++ b/configure Tue May 25 16:01:57 2021 +0200
@@ -731,6 +731,9 @@
731731 LIB_WEBP
732732 HasWEBP_FALSE
733733 HasWEBP_TRUE
734+LIB_JXL
735+HasJXL_FALSE
736+HasJXL_TRUE
734737 LIB_JBIG
735738 HasJBIG_FALSE
736739 HasJBIG_TRUE
@@ -1063,6 +1066,7 @@
10631066 with_webp
10641067 with_jpeg
10651068 with_jp2
1069+with_jxl
10661070 with_lcms2
10671071 with_lzma
10681072 with_png
@@ -1788,6 +1792,7 @@
17881792 --without-webp disable WEBP support
17891793 --without-jpeg disable JPEG support
17901794 --without-jp2 disable JPEG v2 support
1795+ --without-jxl disable JPEG-XL support
17911796 --without-lcms2 disable lcms (v2.X) support
17921797 --without-lzma disable LZMA support
17931798 --without-png disable PNG support
@@ -19443,6 +19448,19 @@
1944319448 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
1944419449 fi
1944519450
19451+# Disable JXL
19452+
19453+# Check whether --with-jxl was given.
19454+if test "${with_jxl+set}" = set; then :
19455+ withval=$with_jxl; with_jxl=$withval
19456+else
19457+ with_jxl='yes'
19458+fi
19459+
19460+if test "$with_jxl" != 'yes' ; then
19461+ DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
19462+fi
19463+
1944619464 # Disable LCMS2.
1944719465
1944819466 # Check whether --with-lcms2 was given.
@@ -27038,6 +27056,192 @@
2703827056
2703927057
2704027058 #
27059+# Check for JXL
27060+#
27061+have_jxl='no'
27062+LIB_JXL=''
27063+if test "$with_jxl" != 'no'
27064+then
27065+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JXL support " >&5
27066+$as_echo_n "checking for JXL support ... " >&6; }
27067+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
27068+$as_echo "" >&6; }
27069+ failed=0
27070+ passed=0
27071+ ac_fn_c_check_header_mongrel "$LINENO" "jxl/decode.h" "ac_cv_header_jxl_decode_h" "$ac_includes_default"
27072+if test "x$ac_cv_header_jxl_decode_h" = xyes; then :
27073+ passed=`expr $passed + 1`
27074+else
27075+ failed=`expr $failed + 1`
27076+fi
27077+
27078+
27079+ # jxl always requires hwy no extra test needed
27080+ # Both hwy and jxl are c++ projects. Therefore either link with c++ or
27081+ # manually add libstdc++
27082+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JxlDecoderCreate in -ljxl" >&5
27083+$as_echo_n "checking for JxlDecoderCreate in -ljxl... " >&6; }
27084+if ${ac_cv_lib_jxl_JxlDecoderCreate+:} false; then :
27085+ $as_echo_n "(cached) " >&6
27086+else
27087+ ac_check_lib_save_LIBS=$LIBS
27088+LIBS="-ljxl -lhwy -lstdc++ $LIBS"
27089+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27090+/* end confdefs.h. */
27091+
27092+/* Override any GCC internal prototype to avoid an error.
27093+ Use char because int might match the return type of a GCC
27094+ builtin and then its argument prototype would still apply. */
27095+#ifdef __cplusplus
27096+extern "C"
27097+#endif
27098+char JxlDecoderCreate ();
27099+int
27100+main ()
27101+{
27102+return JxlDecoderCreate ();
27103+ ;
27104+ return 0;
27105+}
27106+_ACEOF
27107+if ac_fn_c_try_link "$LINENO"; then :
27108+ ac_cv_lib_jxl_JxlDecoderCreate=yes
27109+else
27110+ ac_cv_lib_jxl_JxlDecoderCreate=no
27111+fi
27112+rm -f core conftest.err conftest.$ac_objext \
27113+ conftest$ac_exeext conftest.$ac_ext
27114+LIBS=$ac_check_lib_save_LIBS
27115+fi
27116+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jxl_JxlDecoderCreate" >&5
27117+$as_echo "$ac_cv_lib_jxl_JxlDecoderCreate" >&6; }
27118+if test "x$ac_cv_lib_jxl_JxlDecoderCreate" = xyes; then :
27119+ passed=`expr $passed + 1`
27120+else
27121+ failed=`expr $failed + 1`
27122+fi
27123+
27124+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JxlThreadParallelRunnerCreate in -ljxl_threads" >&5
27125+$as_echo_n "checking for JxlThreadParallelRunnerCreate in -ljxl_threads... " >&6; }
27126+if ${ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate+:} false; then :
27127+ $as_echo_n "(cached) " >&6
27128+else
27129+ ac_check_lib_save_LIBS=$LIBS
27130+LIBS="-ljxl_threads -lstdc++ $LIBS"
27131+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27132+/* end confdefs.h. */
27133+
27134+/* Override any GCC internal prototype to avoid an error.
27135+ Use char because int might match the return type of a GCC
27136+ builtin and then its argument prototype would still apply. */
27137+#ifdef __cplusplus
27138+extern "C"
27139+#endif
27140+char JxlThreadParallelRunnerCreate ();
27141+int
27142+main ()
27143+{
27144+return JxlThreadParallelRunnerCreate ();
27145+ ;
27146+ return 0;
27147+}
27148+_ACEOF
27149+if ac_fn_c_try_link "$LINENO"; then :
27150+ ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate=yes
27151+else
27152+ ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate=no
27153+fi
27154+rm -f core conftest.err conftest.$ac_objext \
27155+ conftest$ac_exeext conftest.$ac_ext
27156+LIBS=$ac_check_lib_save_LIBS
27157+fi
27158+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate" >&5
27159+$as_echo "$ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate" >&6; }
27160+if test "x$ac_cv_lib_jxl_threads_JxlThreadParallelRunnerCreate" = xyes; then :
27161+ passed=`expr $passed + 1`
27162+else
27163+ failed=`expr $failed + 1`
27164+fi
27165+
27166+ # Testing for decoder should also cover encoder
27167+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BrotliDecoderVersion in -lbrotlidec" >&5
27168+$as_echo_n "checking for BrotliDecoderVersion in -lbrotlidec... " >&6; }
27169+if ${ac_cv_lib_brotlidec_BrotliDecoderVersion+:} false; then :
27170+ $as_echo_n "(cached) " >&6
27171+else
27172+ ac_check_lib_save_LIBS=$LIBS
27173+LIBS="-lbrotlidec $LIBS"
27174+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27175+/* end confdefs.h. */
27176+
27177+/* Override any GCC internal prototype to avoid an error.
27178+ Use char because int might match the return type of a GCC
27179+ builtin and then its argument prototype would still apply. */
27180+#ifdef __cplusplus
27181+extern "C"
27182+#endif
27183+char BrotliDecoderVersion ();
27184+int
27185+main ()
27186+{
27187+return BrotliDecoderVersion ();
27188+ ;
27189+ return 0;
27190+}
27191+_ACEOF
27192+if ac_fn_c_try_link "$LINENO"; then :
27193+ ac_cv_lib_brotlidec_BrotliDecoderVersion=yes
27194+else
27195+ ac_cv_lib_brotlidec_BrotliDecoderVersion=no
27196+fi
27197+rm -f core conftest.err conftest.$ac_objext \
27198+ conftest$ac_exeext conftest.$ac_ext
27199+LIBS=$ac_check_lib_save_LIBS
27200+fi
27201+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_brotlidec_BrotliDecoderVersion" >&5
27202+$as_echo "$ac_cv_lib_brotlidec_BrotliDecoderVersion" >&6; }
27203+if test "x$ac_cv_lib_brotlidec_BrotliDecoderVersion" = xyes; then :
27204+ passed=`expr $passed + 1`
27205+else
27206+ failed=`expr $failed + 1`
27207+fi
27208+
27209+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if JXL package is complete" >&5
27210+$as_echo_n "checking if JXL package is complete... " >&6; }
27211+ if test $passed -gt 0
27212+ then
27213+ if test $failed -gt 0
27214+ then
27215+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no -- some components failed test" >&5
27216+$as_echo "no -- some components failed test" >&6; }
27217+ have_jxl='no (failed tests)'
27218+ else
27219+ LIB_JXL='-ljxl -ljxl_threads -lhwy -lstdc++ -lbrotlidec -lbrotlienc'
27220+ LIBS="$LIB_JXL $LIBS"
27221+
27222+$as_echo "#define HasJXL 1" >>confdefs.h
27223+
27224+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27225+$as_echo "yes" >&6; }
27226+ have_jxl='yes'
27227+ fi
27228+ else
27229+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27230+$as_echo "no" >&6; }
27231+ fi
27232+fi
27233+ if test "$have_jxl" = 'yes'; then
27234+ HasJXL_TRUE=
27235+ HasJXL_FALSE='#'
27236+else
27237+ HasJXL_TRUE='#'
27238+ HasJXL_FALSE=
27239+fi
27240+
27241+
27242+
27243+
27244+#
2704127245 # Check for WEBP
2704227246 #
2704327247 have_webp='no'
@@ -29926,6 +30130,10 @@
2992630130 DELEGATES="$DELEGATES jbig"
2992730131 MAGICK_FEATURES="$MAGICK_FEATURES JBIG"
2992830132 fi
30133+if test "$have_jxl" = 'yes' ; then
30134+ DELEGATES="$DELEGATES jxl"
30135+ MAGICK_FEATURES="$MAGICK_FEATURES JXL"
30136+fi
2992930137 if test "$have_webp" = 'yes' ; then
2993030138 DELEGATES="$DELEGATES webp"
2993130139 MAGICK_FEATURES="$MAGICK_FEATURES WEBP"
@@ -30051,7 +30259,7 @@
3005130259 then
3005230260 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"
3005330261 else
30054- 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"
30262+ MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_JXL $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"
3005530263 fi
3005630264 MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
3005730265
@@ -30418,6 +30626,10 @@
3041830626 as_fn_error $? "conditional \"HasJBIG\" was never defined.
3041930627 Usually this means the macro was only invoked conditionally." "$LINENO" 5
3042030628 fi
30629+if test -z "${HasJXL_TRUE}" && test -z "${HasJXL_FALSE}"; then
30630+ as_fn_error $? "conditional \"HasJXL\" was never defined.
30631+Usually this means the macro was only invoked conditionally." "$LINENO" 5
30632+fi
3042130633 if test -z "${HasWEBP_TRUE}" && test -z "${HasWEBP_FALSE}"; then
3042230634 as_fn_error $? "conditional \"HasWEBP\" was never defined.
3042330635 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -32958,6 +33170,7 @@
3295833170 printf "JBIG --with-jbig=$with_jbig \t$have_jbig\n"
3295933171 printf "JPEG v1 --with-jpeg=$with_jpeg \t$have_jpeg\n"
3296033172 printf "JPEG-2000 --with-jp2=$with_jp2 \t$have_jp2\n"
33173+printf "JPEG-XL --with-jxl=$with_jxl \t$have_jxl\n"
3296133174 printf "LCMS v2 --with-lcms2=$with_lcms2 \t$have_lcms2\n"
3296233175 # printf "MPEG v2 --with-mpeg2=$with_mpeg2 \t$have_mpeg2\n"
3296333176 printf "LZMA --with-lzma=$with_lzma \t$have_lzma\n"
diff -r 48c9416cca66 -r de5b3c1ea727 configure.ac
--- a/configure.ac Mon May 10 11:16:24 2021 -0500
+++ b/configure.ac Tue May 25 16:01:57 2021 +0200
@@ -706,6 +706,16 @@
706706 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
707707 fi
708708
709+# Disable JXL
710+AC_ARG_WITH([jxl],
711+ AS_HELP_STRING([--without-jxl],
712+ [disable JPEG-XL support]),
713+ [with_jxl=$withval],
714+ [with_jxl='yes'])
715+if test "$with_jxl" != 'yes' ; then
716+ DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
717+fi
718+
709719 # Disable LCMS2.
710720 AC_ARG_WITH([lcms2],
711721 AS_HELP_STRING([--without-lcms2],
@@ -2497,6 +2507,47 @@
24972507 AC_SUBST([LIB_JBIG])
24982508
24992509 #
2510+# Check for JXL
2511+#
2512+have_jxl='no'
2513+LIB_JXL=''
2514+if test "$with_jxl" != 'no'
2515+then
2516+ AC_MSG_CHECKING([for JXL support ])
2517+ AC_MSG_RESULT()
2518+ failed=0
2519+ passed=0
2520+ AC_CHECK_HEADER([jxl/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2521+ # jxl always requires hwy no extra test needed
2522+ # Both hwy and jxl are c++ projects. Therefore either link with c++ or
2523+ # manually add libstdc++
2524+ AC_CHECK_LIB([jxl],[JxlDecoderCreate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[-lhwy -lstdc++])
2525+ AC_CHECK_LIB([jxl_threads],[JxlThreadParallelRunnerCreate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[-lstdc++])
2526+ # Testing for decoder should also cover encoder
2527+ AC_CHECK_LIB([brotlidec],[BrotliDecoderVersion],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2528+ AC_MSG_CHECKING([if JXL package is complete])
2529+ if test $passed -gt 0
2530+ then
2531+ if test $failed -gt 0
2532+ then
2533+ AC_MSG_RESULT([no -- some components failed test])
2534+ have_jxl='no (failed tests)'
2535+ else
2536+ LIB_JXL='-ljxl -ljxl_threads -lhwy -lstdc++ -lbrotlidec -lbrotlienc'
2537+ LIBS="$LIB_JXL $LIBS"
2538+ AC_DEFINE([HasJXL],[1],[Define if you have JXL library])
2539+ AC_MSG_RESULT([yes])
2540+ have_jxl='yes'
2541+ fi
2542+ else
2543+ AC_MSG_RESULT([no])
2544+ fi
2545+fi
2546+AM_CONDITIONAL([HasJXL],[test "$have_jxl" = 'yes'])
2547+AC_SUBST([LIB_JXL])
2548+
2549+
2550+#
25002551 # Check for WEBP
25012552 #
25022553 have_webp='no'
@@ -3545,6 +3596,10 @@
35453596 DELEGATES="$DELEGATES jbig"
35463597 MAGICK_FEATURES="$MAGICK_FEATURES JBIG"
35473598 fi
3599+if test "$have_jxl" = 'yes' ; then
3600+ DELEGATES="$DELEGATES jxl"
3601+ MAGICK_FEATURES="$MAGICK_FEATURES JXL"
3602+fi
35483603 if test "$have_webp" = 'yes' ; then
35493604 DELEGATES="$DELEGATES webp"
35503605 MAGICK_FEATURES="$MAGICK_FEATURES WEBP"
@@ -3674,7 +3729,7 @@
36743729 then
36753730 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"
36763731 else
3677- 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"
3732+ MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_JXL $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"
36783733 fi
36793734 MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
36803735 AC_SUBST([MAGICK_DEP_LIBS])
@@ -3801,6 +3856,7 @@
38013856 printf "JBIG --with-jbig=$with_jbig \t$have_jbig\n"
38023857 printf "JPEG v1 --with-jpeg=$with_jpeg \t$have_jpeg\n"
38033858 printf "JPEG-2000 --with-jp2=$with_jp2 \t$have_jp2\n"
3859+printf "JPEG-XL --with-jxl=$with_jxl \t$have_jxl\n"
38043860 printf "LCMS v2 --with-lcms2=$with_lcms2 \t$have_lcms2\n"
38053861 # printf "MPEG v2 --with-mpeg2=$with_mpeg2 \t$have_mpeg2\n"
38063862 printf "LZMA --with-lzma=$with_lzma \t$have_lzma\n"
diff -r 48c9416cca66 -r de5b3c1ea727 magick/magick_config.h.in
--- a/magick/magick_config.h.in Mon May 10 11:16:24 2021 -0500
+++ b/magick/magick_config.h.in Tue May 25 16:01:57 2021 +0200
@@ -432,6 +432,9 @@
432432 /* Define if you have JPEG library */
433433 #undef HasJPEG
434434
435+/* Define if you have JPEG-XL library */
436+#undef HasJXL
437+
435438 /* Define if you have LCMS (v2.0 or later) library */
436439 #undef HasLCMS
437440
diff -r 48c9416cca66 -r de5b3c1ea727 magick/static.c
--- a/magick/static.c Mon May 10 11:16:24 2021 -0500
+++ b/magick/static.c Tue May 25 16:01:57 2021 +0200
@@ -111,6 +111,9 @@
111111 #if defined(HasJP2)
112112 STATICM("JP2",RegisterJP2Image,UnregisterJP2Image),
113113 #endif
114+#if defined(HasJXL)
115+ STATICM("JXL",RegisterJXLImage,UnregisterJXLImage),
116+#endif
114117 STATICM("LABEL",RegisterLABELImage,UnregisterLABELImage),
115118 STATICM("LOCALE",RegisterLOCALEImage,UnregisterLOCALEImage),
116119 STATICM("LOGO",RegisterLOGOImage,UnregisterLOGOImage),
diff -r 48c9416cca66 -r de5b3c1ea727 magick/static.h
--- a/magick/static.h Mon May 10 11:16:24 2021 -0500
+++ b/magick/static.h Tue May 25 16:01:57 2021 +0200
@@ -70,6 +70,7 @@
7070 RegisterJPGImage(void),
7171 RegisterJPEGImage(void),
7272 RegisterJP2Image(void),
73+ RegisterJXLImage(void),
7374 RegisterLABELImage(void),
7475 RegisterLOCALEImage(void),
7576 RegisterLOGOImage(void),
@@ -215,6 +216,7 @@
215216 UnregisterJPGImage(void),
216217 UnregisterJPEGImage(void),
217218 UnregisterJP2Image(void),
219+ UnregisterJXLImage(void),
218220 UnregisterLABELImage(void),
219221 UnregisterLOCALEImage(void),
220222 UnregisterLOGOImage(void),
Show on old repository browser