File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
- morph: fix erode Highway path [kleisauke]
6
6
- morph: fix C-paths with masks containing zero [kleisauke]
7
7
- fix `--vips-info` CLI flag with GLib >= 2.80 [kleisauke]
8
+ - make `subsample-mode=on` and `lossless=true` mutually exclusive [kleisauke]
8
9
9
10
10/10/24 8.16.0
10
11
Original file line number Diff line number Diff line change @@ -526,11 +526,9 @@ vips_foreign_save_heif_build(VipsObject *object)
526
526
!vips_object_argument_isset (object , "effort" ))
527
527
heif -> effort = 9 - heif -> speed ;
528
528
529
- /* Disable chroma subsampling by default when the "lossless" param
530
- * is being used.
529
+ /* The "lossless" param implies no chroma subsampling.
531
530
*/
532
- if (vips_object_argument_isset (object , "lossless" ) &&
533
- !vips_object_argument_isset (object , "subsample_mode" ))
531
+ if (heif -> lossless )
534
532
heif -> subsample_mode = VIPS_FOREIGN_SUBSAMPLE_OFF ;
535
533
536
534
/* Default 12 bit save for 16-bit images.
Original file line number Diff line number Diff line change @@ -819,11 +819,14 @@ vips_foreign_save_jp2k_build(VipsObject *object)
819
819
return -1 ;
820
820
}
821
821
822
+ /* The "lossless" param implies no chroma subsampling.
823
+ */
824
+ if (jp2k -> lossless )
825
+ jp2k -> subsample_mode = VIPS_FOREIGN_SUBSAMPLE_OFF ;
826
+
822
827
switch (jp2k -> subsample_mode ) {
823
828
case VIPS_FOREIGN_SUBSAMPLE_AUTO :
824
- jp2k -> subsample =
825
- !jp2k -> lossless &&
826
- jp2k -> Q < 90 &&
829
+ jp2k -> subsample = jp2k -> Q < 90 &&
827
830
(save -> ready -> Type == VIPS_INTERPRETATION_sRGB ||
828
831
save -> ready -> Type == VIPS_INTERPRETATION_RGB16 ) &&
829
832
save -> ready -> Bands == 3 ;
You can’t perform that action at this time.
0 commit comments