1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
From c87f60413a28da4a28f94f92680c6e4458cbe16b Mon Sep 17 00:00:00 2001
From: Timo Gurr <timo.gurr@gmail.com>
Date: Fri, 29 Dec 2023 10:34:55 +0100
Subject: [PATCH] jxl: added support for version 0.9.0
---
extensions/cairo_io/cairo-image-surface-jxl.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/extensions/cairo_io/cairo-image-surface-jxl.c b/extensions/cairo_io/cairo-image-surface-jxl.c
index 72365897..01ceaaa6 100644
--- a/extensions/cairo_io/cairo-image-surface-jxl.c
+++ b/extensions/cairo_io/cairo-image-surface-jxl.c
@@ -236,18 +236,30 @@ _cairo_image_surface_create_from_jxl(GInputStream *istream,
case JXL_DEC_COLOR_ENCODING:
#if HAVE_LCMS2
- if (JxlDecoderGetColorAsEncodedProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, NULL) == JXL_DEC_SUCCESS)
+ if (JxlDecoderGetColorAsEncodedProfile(dec,
+#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
+ &pixel_format,
+#endif
+ JXL_COLOR_PROFILE_TARGET_DATA, NULL) == JXL_DEC_SUCCESS)
break;
{
gsize profile_size;
- if (JxlDecoderGetICCProfileSize(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &profile_size) > 0) {
+ if (JxlDecoderGetICCProfileSize(dec,
+#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
+ &pixel_format,
+#endif
+ JXL_COLOR_PROFILE_TARGET_DATA, &profile_size) > 0) {
g_message("Could not get ICC profile size.\n");
break;
}
guchar *profile_data = g_new(guchar, profile_size);
- if (JxlDecoderGetColorAsICCProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, profile_data, profile_size) > 0) {
+ if (JxlDecoderGetColorAsICCProfile(dec,
+#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,9,0)
+ &pixel_format,
+#endif
+ JXL_COLOR_PROFILE_TARGET_DATA, profile_data, profile_size) > 0) {
g_message("Could not get ICC profile.\n");
g_free(profile_data);
break;
--
2.43.0
|