Skip to content

Commit 0de1387

Browse files
authored
apply jxl patch from gthumb, adds support for jxl-0.9.0 (#205)
1 parent 7acaf48 commit 0de1387

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

extensions/cairo_io/cairo-image-surface-jxl.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,30 @@ _cairo_image_surface_create_from_jxl(GInputStream *istream,
234234

235235
case JXL_DEC_COLOR_ENCODING:
236236
#if HAVE_LCMS2
237-
if (JxlDecoderGetColorAsEncodedProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, NULL) == JXL_DEC_SUCCESS)
237+
if (JxlDecoderGetColorAsEncodedProfile(dec,
238+
#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
239+
&pixel_format,
240+
#endif
241+
JXL_COLOR_PROFILE_TARGET_DATA, NULL) == JXL_DEC_SUCCESS)
238242
break;
239243

240244
{
241245
gsize profile_size;
242-
if (JxlDecoderGetICCProfileSize(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &profile_size) > 0) {
246+
if (JxlDecoderGetICCProfileSize(dec,
247+
#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
248+
&pixel_format,
249+
#endif
250+
JXL_COLOR_PROFILE_TARGET_DATA, &profile_size) > 0) {
243251
g_message("Could not get ICC profile size.\n");
244252
break;
245253
}
246254

247255
guchar *profile_data = g_new(guchar, profile_size);
248-
if (JxlDecoderGetColorAsICCProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, profile_data, profile_size) > 0) {
256+
if (JxlDecoderGetColorAsICCProfile(dec,
257+
#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
258+
&pixel_format,
259+
#endif
260+
JXL_COLOR_PROFILE_TARGET_DATA, profile_data, profile_size) > 0) {
249261
g_message("Could not get ICC profile.\n");
250262
g_free(profile_data);
251263
break;

0 commit comments

Comments
 (0)