From e522b4ff90ec8a61d3f67e63ba6d563d2c70a2c7 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 21 May 2022 09:49:31 +0100 Subject: [PATCH 1/2] jxl: remove support for never-implemented JXL_TYPE_UINT32 (#2813) --- libvips/foreign/jxlload.c | 10 ---------- libvips/foreign/jxlsave.c | 16 +++------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/libvips/foreign/jxlload.c b/libvips/foreign/jxlload.c index ef3f0102..a0ad7a87 100644 --- a/libvips/foreign/jxlload.c +++ b/libvips/foreign/jxlload.c @@ -349,10 +349,6 @@ vips_foreign_load_jxl_print_format( JxlPixelFormat *format ) printf( "JXL_TYPE_UINT16" ); break; - case JXL_TYPE_UINT32: - printf( "JXL_TYPE_UINT32" ); - break; - case JXL_TYPE_FLOAT: printf( "JXL_TYPE_FLOAT" ); break; @@ -421,10 +417,6 @@ vips_foreign_load_jxl_set_header( VipsForeignLoadJxl *jxl, VipsImage *out ) format = VIPS_FORMAT_USHORT; break; - case JXL_TYPE_UINT32: - format = VIPS_FORMAT_UINT; - break; - case JXL_TYPE_FLOAT: format = VIPS_FORMAT_FLOAT; break; @@ -550,8 +542,6 @@ vips_foreign_load_jxl_header( VipsForeignLoad *load ) if( jxl->info.exponent_bits_per_sample > 0 || jxl->info.alpha_exponent_bits > 0 ) jxl->format.data_type = JXL_TYPE_FLOAT; - else if( jxl->info.bits_per_sample > 16 ) - jxl->format.data_type = JXL_TYPE_UINT32; else if( jxl->info.bits_per_sample > 8 ) jxl->format.data_type = JXL_TYPE_UINT16; else diff --git a/libvips/foreign/jxlsave.c b/libvips/foreign/jxlsave.c index f762a358..4c8677fa 100644 --- a/libvips/foreign/jxlsave.c +++ b/libvips/foreign/jxlsave.c @@ -178,10 +178,6 @@ vips_foreign_save_jxl_print_format( JxlPixelFormat *format ) printf( "JXL_TYPE_UINT16" ); break; - case JXL_TYPE_UINT32: - printf( "JXL_TYPE_UINT32" ); - break; - case JXL_TYPE_FLOAT: printf( "JXL_TYPE_FLOAT" ); break; @@ -278,12 +274,6 @@ vips_foreign_save_jxl_build( VipsObject *object ) jxl->format.data_type = JXL_TYPE_UINT16; break; - case VIPS_FORMAT_UINT: - jxl->info.bits_per_sample = 32; - jxl->info.exponent_bits_per_sample = 0; - jxl->format.data_type = JXL_TYPE_UINT32; - break; - case VIPS_FORMAT_FLOAT: jxl->info.bits_per_sample = 32; jxl->info.exponent_bits_per_sample = 8; @@ -441,9 +431,9 @@ vips_foreign_save_jxl_build( VipsObject *object ) /* Type promotion for save ... unsigned ints + float + double. */ -static int bandfmt_jpeg[10] = { +static int bandfmt_jxl[10] = { /* UC C US S UI I F X D DX */ - UC, UC, US, US, UI, UI, F, F, F, F + UC, UC, US, US, F, F, F, F, F, F }; static void @@ -465,7 +455,7 @@ vips_foreign_save_jxl_class_init( VipsForeignSaveJxlClass *class ) foreign_class->suffs = vips__jxl_suffs; save_class->saveable = VIPS_SAVEABLE_ANY; - save_class->format_table = bandfmt_jpeg; + save_class->format_table = bandfmt_jxl; VIPS_ARG_INT( class, "tier", 10, _( "Tier" ), From 6e80364e0a68b3ad9b20a7cdb72e9605a5dcf502 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 21 May 2022 09:52:58 +0100 Subject: [PATCH 2/2] fix jxl compat break note in changelog see https://github.com/libvips/libvips/pull/2813 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2ab2ede1..868e9a7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - better arg checking for hist_find_ndim [travisbell] - fix thumbnail with CMYK output [AdamGaskins] - fix size_t / ssize_t confusion [flga] +- fix jxl compatibility break [lovell] 26/11/21 started 8.12.2 - make exif resuint optional and default to inch