File tree Expand file tree Collapse file tree 5 files changed +16
-4
lines changed Expand file tree Collapse file tree 5 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ TBD 8.15.1
2
2
3
3
- reduceh: fix Highway path on SSE2 [DarthSim]
4
4
- fix JPEG in TIFF colourspace for Q >= 90 [heman1-test]
5
+ - fix build with upcoming libjxl 0.9 [kleisauke]
6
+ - jxlsave: lower min effort value to 1 [DarthSim]
5
7
6
8
11/11/23 8.15.0
7
9
Original file line number Diff line number Diff line change @@ -564,7 +564,9 @@ vips_foreign_load_jxl_header(VipsForeignLoad *load)
564
564
565
565
case JXL_DEC_COLOR_ENCODING :
566
566
if (JxlDecoderGetICCProfileSize (jxl -> decoder ,
567
+ #ifndef HAVE_LIBJXL_0_9
567
568
& jxl -> format ,
569
+ #endif
568
570
JXL_COLOR_PROFILE_TARGET_DATA ,
569
571
& jxl -> icc_size )) {
570
572
vips_foreign_load_jxl_error (jxl ,
@@ -583,7 +585,9 @@ vips_foreign_load_jxl_header(VipsForeignLoad *load)
583
585
return -1 ;
584
586
585
587
if (JxlDecoderGetColorAsICCProfile (jxl -> decoder ,
588
+ #ifndef HAVE_LIBJXL_0_9
586
589
& jxl -> format ,
590
+ #endif
587
591
JXL_COLOR_PROFILE_TARGET_DATA ,
588
592
jxl -> icc_data , jxl -> icc_size )) {
589
593
vips_foreign_load_jxl_error (jxl ,
Original file line number Diff line number Diff line change @@ -243,13 +243,16 @@ vips_foreign_save_jxl_build(VipsObject *object)
243
243
return -1 ;
244
244
245
245
/* If Q is set and distance is not, use Q to set a rough distance
246
- * value. Formula stolen from cjxl.c and very roughly approximates
247
- * libjpeg values.
246
+ * value.
248
247
*/
249
248
if (!vips_object_argument_isset (object , "distance" ))
249
+ #ifdef HAVE_LIBJXL_0_9
250
+ jxl -> distance = JxlEncoderDistanceFromQuality ((float ) jxl -> Q );
251
+ #else
250
252
jxl -> distance = jxl -> Q >= 30
251
253
? 0.1 + (100 - jxl -> Q ) * 0.09
252
254
: 53.0 / 3000.0 * jxl -> Q * jxl -> Q - 23.0 / 20.0 * jxl -> Q + 25.0 ;
255
+ #endif
253
256
254
257
/* Distance 0 is lossless. libjxl will fail for lossy distance 0.
255
258
*/
@@ -558,7 +561,7 @@ vips_foreign_save_jxl_class_init(VipsForeignSaveJxlClass *class)
558
561
_ ("Encoding effort" ),
559
562
VIPS_ARGUMENT_OPTIONAL_INPUT ,
560
563
G_STRUCT_OFFSET (VipsForeignSaveJxl , effort ),
561
- 3 , 9 , 7 );
564
+ 1 , 9 , 7 );
562
565
563
566
VIPS_ARG_BOOL (class , "lossless" , 13 ,
564
567
_ ("Lossless" ),
Original file line number Diff line number Diff line change @@ -527,6 +527,9 @@ if libjxl_found
527
527
if libjxl_dep.version().version_compare(' >=0.7' )
528
528
cfg_var.set(' HAVE_LIBJXL_0_7' , ' 1' )
529
529
endif
530
+ if libjxl_dep.version().version_compare(' >=0.9' )
531
+ cfg_var.set(' HAVE_LIBJXL_0_9' , ' 1' )
532
+ endif
530
533
endif
531
534
532
535
libpoppler_dep = dependency (' poppler-glib' , version : ' >=0.16.0' , required : get_option (' poppler' ))
Original file line number Diff line number Diff line change @@ -1533,7 +1533,7 @@ def test_jxlsave(self):
1533
1533
# remove the ICC profile: the RGB one will no longer be appropriate
1534
1534
rgb16 .remove ("icc-profile-data" )
1535
1535
self .save_load_buffer ("jxlsave_buffer" , "jxlload_buffer" ,
1536
- rgb16 , 10700 )
1536
+ rgb16 , 12000 )
1537
1537
1538
1538
# repeat for lossless mode
1539
1539
self .save_load_buffer ("jxlsave_buffer" , "jxlload_buffer" ,
You can’t perform that action at this time.
0 commit comments