@@ -229,7 +229,11 @@ vips_foreign_save_jxl_build( VipsObject *object )
229
229
VipsForeignSaveJxl * jxl = (VipsForeignSaveJxl * ) object ;
230
230
VipsImage * * t = (VipsImage * * ) vips_object_local_array ( object , 5 );
231
231
232
- JxlEncoderOptions * options ;
232
+ #ifdef HAVE_LIBJXL_0_7
233
+ JxlEncoderFrameSettings * frame_settings ;
234
+ #else
235
+ JxlEncoderOptions * frame_settings ;
236
+ #endif
233
237
JxlEncoderStatus status ;
234
238
VipsImage * in ;
235
239
VipsBandFormat format ;
@@ -415,23 +419,33 @@ vips_foreign_save_jxl_build( VipsObject *object )
415
419
if ( vips_image_wio_input ( in ) )
416
420
return ( -1 );
417
421
418
- options = JxlEncoderOptionsCreate ( jxl -> encoder , NULL );
419
- JxlEncoderOptionsSetDecodingSpeed ( options , jxl -> tier );
420
- JxlEncoderOptionsSetDistance ( options , jxl -> distance );
421
- JxlEncoderOptionsSetEffort ( options , jxl -> effort );
422
- JxlEncoderOptionsSetLossless ( options , jxl -> lossless );
422
+ #ifdef HAVE_LIBJXL_0_7
423
+ frame_settings = JxlEncoderFrameSettingsCreate ( jxl -> encoder , NULL );
424
+ JxlEncoderFrameSettingsSetOption ( frame_settings ,
425
+ JXL_ENC_FRAME_SETTING_DECODING_SPEED , jxl -> tier );
426
+ JxlEncoderSetFrameDistance ( frame_settings , jxl -> distance );
427
+ JxlEncoderFrameSettingsSetOption ( frame_settings ,
428
+ JXL_ENC_FRAME_SETTING_EFFORT , jxl -> effort );
429
+ JxlEncoderSetFrameLossless ( frame_settings , jxl -> lossless );
430
+ #else
431
+ frame_settings = JxlEncoderOptionsCreate ( jxl -> encoder , NULL );
432
+ JxlEncoderOptionsSetDecodingSpeed ( frame_settings , jxl -> tier );
433
+ JxlEncoderOptionsSetDistance ( frame_settings , jxl -> distance );
434
+ JxlEncoderOptionsSetEffort ( frame_settings , jxl -> effort );
435
+ JxlEncoderOptionsSetLossless ( frame_settings , jxl -> lossless );
436
+ #endif
423
437
424
438
#ifdef DEBUG
425
439
vips_foreign_save_jxl_print_info ( & jxl -> info );
426
440
vips_foreign_save_jxl_print_format ( & jxl -> format );
427
- printf ( "JxlEncoderOptions :\n" );
441
+ printf ( "JxlEncoderFrameSettings :\n" );
428
442
printf ( " tier = %d\n" , jxl -> tier );
429
443
printf ( " distance = %g\n" , jxl -> distance );
430
444
printf ( " effort = %d\n" , jxl -> effort );
431
445
printf ( " lossless = %d\n" , jxl -> lossless );
432
446
#endif /*DEBUG*/
433
447
434
- if ( JxlEncoderAddImageFrame ( options , & jxl -> format ,
448
+ if ( JxlEncoderAddImageFrame ( frame_settings , & jxl -> format ,
435
449
VIPS_IMAGE_ADDR ( in , 0 , 0 ),
436
450
VIPS_IMAGE_SIZEOF_IMAGE ( in ) ) ) {
437
451
vips_foreign_save_jxl_error ( jxl , "JxlEncoderAddImageFrame" );
0 commit comments