* [PR PATCH] libjxl: update to 0.9.2.
@ 2024-02-17 7:57 oreo639
2024-02-18 2:07 ` [PR PATCH] [Merged]: " oreo639
0 siblings, 1 reply; 2+ messages in thread
From: oreo639 @ 2024-02-17 7:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]
There is a new pull request by oreo639 against master on the void-packages repository
https://github.com/oreo639/void-packages libjxl
https://github.com/void-linux/void-packages/pull/48792
libjxl: update to 0.9.2.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/48792.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libjxl-48792.patch --]
[-- Type: text/x-diff, Size: 9752 bytes --]
From e3b8f4b88f365b87dace7462cb329088a650bd1a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Feb 2024 23:55:44 -0800
Subject: [PATCH] libjxl: update to 0.9.2.
---
srcpkgs/libjxl/patches/fix-pixbuf.patch | 184 ------------------------
srcpkgs/libjxl/template | 4 +-
2 files changed, 2 insertions(+), 186 deletions(-)
delete mode 100644 srcpkgs/libjxl/patches/fix-pixbuf.patch
diff --git a/srcpkgs/libjxl/patches/fix-pixbuf.patch b/srcpkgs/libjxl/patches/fix-pixbuf.patch
deleted file mode 100644
index 47166a8f60d185..00000000000000
--- a/srcpkgs/libjxl/patches/fix-pixbuf.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-From 7021ada76bd1c1ee44483027c40233cd2e412637 Mon Sep 17 00:00:00 2001
-From: Leo Izen <leo.izen@gmail.com>
-Date: Mon, 29 Jan 2024 09:21:10 -0500
-Subject: [PATCH] lib/jxl/decode.cc: deduplicate and correct min_size
- calculation
-
-Code to calculate the proper size of the buffer exists in three places
-in this function - one for the standard buffer, one for the extra
-channel buffer, and one for the preview buffer. However, only the code
-for the preview buffer correctly took into account the last row size
-possibly being slightly smaller than the remaining rows.
-
-This commit separates the code out into a separate function to remove
-duplicate code, and uses the algorithm from the prevew buffer which was
-the only correct one.
-
-Signed-off-by: Leo Izen <leo.izen@gmail.com>
----
- lib/jxl/decode.cc | 63 ++++++++++++++++--------------------------
- lib/jxl/decode_test.cc | 8 ++++--
- 2 files changed, 30 insertions(+), 41 deletions(-)
-
-diff --git a/lib/jxl/decode.cc b/lib/jxl/decode.cc
-index b674d1ba885..953342d76e1 100644
---- a/lib/jxl/decode.cc
-+++ b/lib/jxl/decode.cc
-@@ -2348,29 +2348,40 @@ JXL_EXPORT JxlDecoderStatus JxlDecoderSetCms(JxlDecoder* dec,
- return JXL_DEC_SUCCESS;
- }
-
--JXL_EXPORT JxlDecoderStatus JxlDecoderPreviewOutBufferSize(
-- const JxlDecoder* dec, const JxlPixelFormat* format, size_t* size) {
-+static JxlDecoderStatus GetMinSize(const JxlDecoder* dec,
-+ const JxlPixelFormat* format,
-+ size_t num_channels, size_t* min_size,
-+ bool preview) {
- size_t bits;
- JxlDecoderStatus status = PrepareSizeCheck(dec, format, &bits);
- if (status != JXL_DEC_SUCCESS) return status;
-- if (format->num_channels < 3 &&
-- !dec->image_metadata.color_encoding.IsGray()) {
-- return JXL_API_ERROR("Number of channels is too low for color output");
-+ size_t xsize, ysize;
-+ if (preview) {
-+ xsize = dec->metadata.oriented_preview_xsize(dec->keep_orientation);
-+ ysize = dec->metadata.oriented_preview_ysize(dec->keep_orientation);
-+ } else {
-+ GetCurrentDimensions(dec, xsize, ysize);
- }
--
-- size_t xsize = dec->metadata.oriented_preview_xsize(dec->keep_orientation);
-- size_t ysize = dec->metadata.oriented_preview_ysize(dec->keep_orientation);
--
-+ if (num_channels == 0) num_channels = format->num_channels;
- size_t row_size =
-- jxl::DivCeil(xsize * format->num_channels * bits, jxl::kBitsPerByte);
-+ jxl::DivCeil(xsize * num_channels * bits, jxl::kBitsPerByte);
- size_t last_row_size = row_size;
- if (format->align > 1) {
- row_size = jxl::DivCeil(row_size, format->align) * format->align;
- }
-- *size = row_size * (ysize - 1) + last_row_size;
-+ *min_size = row_size * (ysize - 1) + last_row_size;
- return JXL_DEC_SUCCESS;
- }
-
-+JXL_EXPORT JxlDecoderStatus JxlDecoderPreviewOutBufferSize(
-+ const JxlDecoder* dec, const JxlPixelFormat* format, size_t* size) {
-+ if (format->num_channels < 3 &&
-+ !dec->image_metadata.color_encoding.IsGray()) {
-+ return JXL_API_ERROR("Number of channels is too low for color output");
-+ }
-+ return GetMinSize(dec, format, 0, size, true);
-+}
-+
- JXL_EXPORT JxlDecoderStatus JxlDecoderSetPreviewOutBuffer(
- JxlDecoder* dec, const JxlPixelFormat* format, void* buffer, size_t size) {
- if (!dec->got_basic_info || !dec->metadata.m.have_preview ||
-@@ -2401,23 +2412,12 @@ JXL_EXPORT JxlDecoderStatus JxlDecoderSetPreviewOutBuffer(
-
- JXL_EXPORT JxlDecoderStatus JxlDecoderImageOutBufferSize(
- const JxlDecoder* dec, const JxlPixelFormat* format, size_t* size) {
-- size_t bits;
-- JxlDecoderStatus status = PrepareSizeCheck(dec, format, &bits);
-- if (status != JXL_DEC_SUCCESS) return status;
- if (format->num_channels < 3 &&
- !dec->image_metadata.color_encoding.IsGray()) {
- return JXL_API_ERROR("Number of channels is too low for color output");
- }
-- size_t xsize, ysize;
-- GetCurrentDimensions(dec, xsize, ysize);
-- size_t row_size =
-- jxl::DivCeil(xsize * format->num_channels * bits, jxl::kBitsPerByte);
-- if (format->align > 1) {
-- row_size = jxl::DivCeil(row_size, format->align) * format->align;
-- }
-- *size = row_size * ysize;
-
-- return JXL_DEC_SUCCESS;
-+ return GetMinSize(dec, format, 0, size, false);
- }
-
- JxlDecoderStatus JxlDecoderSetImageOutBuffer(JxlDecoder* dec,
-@@ -2463,22 +2463,7 @@ JxlDecoderStatus JxlDecoderExtraChannelBufferSize(const JxlDecoder* dec,
- return JXL_API_ERROR("Invalid extra channel index");
- }
-
-- size_t num_channels = 1; // Do not use format's num_channels
--
-- size_t bits;
-- JxlDecoderStatus status = PrepareSizeCheck(dec, format, &bits);
-- if (status != JXL_DEC_SUCCESS) return status;
--
-- size_t xsize, ysize;
-- GetCurrentDimensions(dec, xsize, ysize);
-- size_t row_size =
-- jxl::DivCeil(xsize * num_channels * bits, jxl::kBitsPerByte);
-- if (format->align > 1) {
-- row_size = jxl::DivCeil(row_size, format->align) * format->align;
-- }
-- *size = row_size * ysize;
--
-- return JXL_DEC_SUCCESS;
-+ return GetMinSize(dec, format, 1, size, false);
- }
-
- JxlDecoderStatus JxlDecoderSetExtraChannelBuffer(JxlDecoder* dec,
-diff --git a/lib/jxl/decode_test.cc b/lib/jxl/decode_test.cc
-index caee6dbc568..310742f705f 100644
---- a/lib/jxl/decode_test.cc
-+++ b/lib/jxl/decode_test.cc
-@@ -2575,7 +2575,11 @@ TEST(DecodeTest, AlignTest) {
- size_t align = 17;
- JxlPixelFormat format = {3, JXL_TYPE_UINT8, JXL_LITTLE_ENDIAN, align};
- // On purpose not using jxl::RoundUpTo to test it independently.
-- size_t expected_line_bytes = (1 * 3 * xsize + align - 1) / align * align;
-+ size_t expected_line_size_last = 1 * 3 * xsize;
-+ size_t expected_line_size =
-+ ((expected_line_size_last + align - 1) / align) * align;
-+ size_t expected_pixels_size =
-+ expected_line_size * (ysize - 1) + expected_line_size_last;
-
- for (int use_callback = 0; use_callback <= 1; ++use_callback) {
- std::vector<uint8_t> pixels2 = jxl::DecodeWithAPI(
-@@ -2583,7 +2587,7 @@ TEST(DecodeTest, AlignTest) {
- /*set_buffer_early=*/false,
- /*use_resizable_runner=*/false, /*require_boxes=*/false,
- /*expect_success=*/true);
-- EXPECT_EQ(expected_line_bytes * ysize, pixels2.size());
-+ EXPECT_EQ(expected_pixels_size, pixels2.size());
- EXPECT_EQ(0u, jxl::test::ComparePixels(pixels.data(), pixels2.data(), xsize,
- ysize, format_orig, format));
- }
-From c4ebb7e70ee09591ae0269410ebe8929f400713e Mon Sep 17 00:00:00 2001
-From: Leo Izen <leo.izen@gmail.com>
-Date: Mon, 29 Jan 2024 09:23:36 -0500
-Subject: [PATCH] plugins/gdk-pixbuf: consider stride when passing buffer to
- libjxl
-
-This change uses gdk_pixbuf_get_pixels_with_length to get the actual
-size of the buffer, with stride taken into account. The previous code
-just multiplies width by height and ignores stride.
-
-Signed-off-by: Leo Izen <leo.izen@gmail.com>
----
- plugins/gdk-pixbuf/pixbufloader-jxl.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/plugins/gdk-pixbuf/pixbufloader-jxl.c b/plugins/gdk-pixbuf/pixbufloader-jxl.c
-index bafa57b1674..066468a5035 100644
---- a/plugins/gdk-pixbuf/pixbufloader-jxl.c
-+++ b/plugins/gdk-pixbuf/pixbufloader-jxl.c
-@@ -491,9 +491,8 @@ static gboolean load_increment(gpointer context, const guchar *buf, guint size,
- decoder_state->frames->len - 1)
- .data;
- decoder_state->pixel_format.align = gdk_pixbuf_get_rowstride(output);
-- guchar *dst = gdk_pixbuf_get_pixels(output);
-- size_t num_pixels = decoder_state->xsize * decoder_state->ysize;
-- size_t size = num_pixels * decoder_state->pixel_format.num_channels;
-+ guint size;
-+ guchar *dst = gdk_pixbuf_get_pixels_with_length(output, &size);
- if (JXL_DEC_SUCCESS != JxlDecoderSetImageOutBuffer(
- decoder_state->decoder,
- &decoder_state->pixel_format, dst, size)) {
diff --git a/srcpkgs/libjxl/template b/srcpkgs/libjxl/template
index bcce3e32135756..27d762c744f6a5 100644
--- a/srcpkgs/libjxl/template
+++ b/srcpkgs/libjxl/template
@@ -1,6 +1,6 @@
# Template file for 'libjxl'
pkgname=libjxl
-version=0.9.1
+version=0.9.2
revision=1
_testdata_hash=ff8d743aaba05b3014f17e5475e576242fa979fc
build_style=cmake
@@ -19,7 +19,7 @@ homepage="https://jpeg.org/jpegxl/"
changelog="https://raw.githubusercontent.com/libjxl/libjxl/main/CHANGELOG.md"
distfiles="https://github.com/libjxl/libjxl/archive/v${version}.tar.gz
https://github.com/libjxl/testdata/archive/${_testdata_hash}.tar.gz>testdata-${_testdata_hash}.tar.gz"
-checksum="a0e72e9ece26878147069ad4888ac3382021d4bbee71c2e1b687d5bde7fd7e01
+checksum="bf28e411d84c50578ab74107cdd624e099313129883a43907c261e8116a11b3b
9c45a108df32a002a69465df896d33acf77d97c88fb59dffa0dff5628370e96f"
patch_args="-Np1 --directory=${build_wrksrc}"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Merged]: libjxl: update to 0.9.2.
2024-02-17 7:57 [PR PATCH] libjxl: update to 0.9.2 oreo639
@ 2024-02-18 2:07 ` oreo639
0 siblings, 0 replies; 2+ messages in thread
From: oreo639 @ 2024-02-18 2:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]
There's a merged pull request on the void-packages repository
libjxl: update to 0.9.2.
https://github.com/void-linux/void-packages/pull/48792
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-18 2:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 7:57 [PR PATCH] libjxl: update to 0.9.2 oreo639
2024-02-18 2:07 ` [PR PATCH] [Merged]: " oreo639
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).