Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Oct 13, 2023
1 parent ecfc82e commit 59e8b6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
- threaded write in tiffsave for tiled JPEG and JPEG2000 [jcupitt]
- add vips_thread_execute() to the public API [jcupitt]
- add "keep" flag to foreign savers, deprecate "strip" [a3mar]
- improve scRGB handling [jcupitt]

18/9/23 8.14.5

- fix a crash with alpha plus icc_import and icc_export [jcupitt]
- fix a crash in jxlsave [jcupitt]
- improve scRGB handling [jcupitt]

15/8/23 8.14.4

Expand Down
19 changes: 15 additions & 4 deletions libvips/foreign/jxlsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
* - add animation support
*
* - libjxl is currently missing error messages (I think)
*
* - add support encoding images with > 4 bands.
*/

#define OUTPUT_BUFFER_SIZE (4096)
Expand Down Expand Up @@ -226,7 +228,7 @@ vips_foreign_save_jxl_build(VipsObject *object)
{
VipsForeignSave *save = (VipsForeignSave *) object;
VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) object;
VipsImage **t = (VipsImage **) vips_object_local_array(object, 5);
VipsImage **t = (VipsImage **) vips_object_local_array(object, 2);

#ifdef HAVE_LIBJXL_0_7
JxlEncoderFrameSettings *frame_settings;
Expand Down Expand Up @@ -282,6 +284,17 @@ vips_foreign_save_jxl_build(VipsObject *object)
return -1;
in = t[0];

/* Mimics VIPS_SAVEABLE_RGBA.
* FIXME: add support encoding images with > 4 bands.
*/
if (in->Bands > 4) {
if (vips_extract_band(in, &t[1], 0,
"n", 4,
NULL))
return -1;
in = t[1];
}

JxlEncoderInitBasicInfo(&jxl->info);

switch (in->BandFmt) {
Expand Down Expand Up @@ -523,9 +536,7 @@ vips_foreign_save_jxl_class_init(VipsForeignSaveJxlClass *class)

foreign_class->suffs = vips__jxl_suffs;

/* This lets throuigh scRGB too, which we then save as jxl float.
*/
save_class->saveable = VIPS_SAVEABLE_RGBA;
save_class->saveable = VIPS_SAVEABLE_ANY;
save_class->format_table = bandfmt_jxl;

VIPS_ARG_INT(class, "tier", 10,
Expand Down

0 comments on commit 59e8b6c

Please sign in to comment.