mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-19 00:13:33 +00:00
graphics/imlib2-jxl: update to 0.2.0 after 026dc43063
Changes: https://github.com/alistair7/imlib2-jxl/releases/tag/v0.2.0 Reported by: GitHub (watch releases)
This commit is contained in:
parent
98f08148d0
commit
0f80a85a1a
@ -1,9 +1,11 @@
|
||||
PORTNAME= imlib2-jxl
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.1.1
|
||||
PORTREVISION= 4
|
||||
DISTVERSION= 0.2.0
|
||||
CATEGORIES= graphics
|
||||
|
||||
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
||||
PATCHFILES+= de2b38f5f34f.patch:-p1 # libjxl 0.9
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
COMMENT= JPEG XL loader for imlib2
|
||||
WWW= https://github.com/alistair7/imlib2-jxl
|
||||
|
@ -1,3 +1,5 @@
|
||||
TIMESTAMP = 1642715616
|
||||
SHA256 (alistair7-imlib2-jxl-v0.1.1_GH0.tar.gz) = 25d220e4638948174d5e76c66e2f0441ee41e0758fa63f065cdfd51bb76c1465
|
||||
SIZE (alistair7-imlib2-jxl-v0.1.1_GH0.tar.gz) = 24731
|
||||
TIMESTAMP = 1682715689
|
||||
SHA256 (alistair7-imlib2-jxl-v0.2.0_GH0.tar.gz) = b49ded4e9251569cfa0245a3075796924656f565e681c60a02c8ec7e16fd9a71
|
||||
SIZE (alistair7-imlib2-jxl-v0.2.0_GH0.tar.gz) = 385197
|
||||
SHA256 (de2b38f5f34f.patch) = 3722403f4caa909535f3cfb37dda1b2c092d6370e2709241736b439b5a2e9cc8
|
||||
SIZE (de2b38f5f34f.patch) = 3181
|
||||
|
@ -1,76 +0,0 @@
|
||||
https://github.com/alistair7/imlib2-jxl/commit/3888defd345f
|
||||
https://github.com/alistair7/imlib2-jxl/commit/06a3b71e4d13
|
||||
https://github.com/alistair7/imlib2-jxl/commit/de2b38f5f34f
|
||||
|
||||
--- imlib2-jxl.c.orig 2022-01-20 21:53:36 UTC
|
||||
+++ imlib2-jxl.c
|
||||
@@ -402,7 +402,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre
|
||||
* extract an ICC profile and save it for later. */
|
||||
|
||||
JxlColorEncoding color_enc;
|
||||
- if(JxlDecoderGetColorAsEncodedProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &color_enc) == JXL_DEC_SUCCESS)
|
||||
+ if(JxlDecoderGetColorAsEncodedProfile(dec, JXL_COLOR_PROFILE_TARGET_DATA, &color_enc) == JXL_DEC_SUCCESS)
|
||||
{
|
||||
if(color_enc.color_space == JXL_COLOR_SPACE_RGB && color_enc.transfer_function == JXL_TRANSFER_FUNCTION_SRGB)
|
||||
{
|
||||
@@ -412,7 +412,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre
|
||||
}
|
||||
}
|
||||
|
||||
- if(JxlDecoderGetICCProfileSize(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size) != JXL_DEC_SUCCESS)
|
||||
+ if(JxlDecoderGetICCProfileSize(dec, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size) != JXL_DEC_SUCCESS)
|
||||
{
|
||||
icc_size = 0;
|
||||
break;
|
||||
@@ -420,7 +420,7 @@ char load(ImlibImage *im, ImlibProgressFunction progre
|
||||
if(!(icc_blob = malloc(icc_size)))
|
||||
RETURN_ERR("Failed to allocate %zu B for ICC profile", icc_size);
|
||||
|
||||
- if(JxlDecoderGetColorAsICCProfile(dec, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, icc_blob, icc_size) != JXL_DEC_SUCCESS)
|
||||
+ if(JxlDecoderGetColorAsICCProfile(dec, JXL_COLOR_PROFILE_TARGET_DATA, icc_blob, icc_size) != JXL_DEC_SUCCESS)
|
||||
icc_size = 0;
|
||||
|
||||
break;
|
||||
@@ -596,9 +596,9 @@ char save(ImlibImage *im, ImlibProgressFunction progre
|
||||
if(JxlEncoderSetParallelRunner(enc, JxlThreadParallelRunner, runner) != JXL_ENC_SUCCESS)
|
||||
RETURN_ERR("Failed in JxlEncoderSetParallelRunner");
|
||||
|
||||
- JxlEncoderOptions *opts;
|
||||
- if(!(opts = JxlEncoderOptionsCreate(enc, NULL)))
|
||||
- RETURN_ERR("Failed in JxlEncoderOptionsCreate");
|
||||
+ JxlEncoderFrameSettings *opts;
|
||||
+ if(!(opts = JxlEncoderFrameSettingsCreate(enc, NULL)))
|
||||
+ RETURN_ERR("Failed in JxlEncoderFrameSettingsCreate");
|
||||
|
||||
JxlPixelFormat pixel_format = { .align = 0, .data_type = JXL_TYPE_UINT8, .num_channels = 4, .endianness = JXL_NATIVE_ENDIAN};
|
||||
|
||||
@@ -633,14 +633,14 @@ char save(ImlibImage *im, ImlibProgressFunction progre
|
||||
quality = max_quality;
|
||||
|
||||
// Transform quality 0-99 to distance 15-0
|
||||
- if(JxlEncoderOptionsSetDistance(opts, 15 - (quality * 15/(float)max_quality)) != JXL_ENC_SUCCESS)
|
||||
- RETURN_ERR("Failed in JxlEncoderOptionsSetDistance: %.1f", 15 - (quality * 15/(float)max_quality));
|
||||
+ if(JxlEncoderSetFrameDistance(opts, 15 - (quality * 15/(float)max_quality)) != JXL_ENC_SUCCESS)
|
||||
+ RETURN_ERR("Failed in JxlEncoderSetFrameDistance: %.1f", 15 - (quality * 15/(float)max_quality));
|
||||
|
||||
// If quality is maxed out, explicity enable lossless mode
|
||||
if(quality == max_quality)
|
||||
{
|
||||
- if(JxlEncoderOptionsSetLossless(opts, 1) != JXL_ENC_SUCCESS)
|
||||
- RETURN_ERR("Failed in JxlEncoderOptionsSetLossless");
|
||||
+ if(JxlEncoderSetFrameLossless(opts, JXL_TRUE) != JXL_ENC_SUCCESS)
|
||||
+ RETURN_ERR("Failed in JxlEncoderSetFrameLossless");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -659,8 +659,8 @@ char save(ImlibImage *im, ImlibProgressFunction progre
|
||||
// Transform compression 0-9 to effort 3-9
|
||||
compression = 3 + (int)roundf(compression * 6/(float)max_compression);
|
||||
|
||||
- if(JxlEncoderOptionsSetEffort(opts, compression) != JXL_ENC_SUCCESS)
|
||||
- RETURN_ERR("Failed in JxlEncoderOptionsSetEffort: %d", compression);
|
||||
+ if(JxlEncoderFrameSettingsSetOption(opts, JXL_ENC_FRAME_SETTING_EFFORT, compression) != JXL_ENC_SUCCESS)
|
||||
+ RETURN_ERR("Failed in JxlEncoderFrameSettingsSetOption(JXL_ENC_FRAME_SETTING_EFFORT, %d)", compression);
|
||||
}
|
||||
|
||||
const size_t pixels_size = 4 * im->w * im->h;
|
Loading…
Reference in New Issue
Block a user