Skip to content

Commit 859c51d

Browse files
authored
Support vips 8.16.0 (#455)
- This removes the usage of the deprecated VIPS_FOREIGN_JPEG_SUBSAMPLE enum, instead using the VIPS_FOREIGN_SUBSAMPLE_ON enum in it's place
1 parent 7c64776 commit 859c51d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

vips/foreign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static SaveParams defaultSaveParams = {
526526
.stripMetadata = FALSE,
527527

528528
.jpegOptimizeCoding = FALSE,
529-
.jpegSubsample = VIPS_FOREIGN_JPEG_SUBSAMPLE_ON,
529+
.jpegSubsample = VIPS_FOREIGN_SUBSAMPLE_ON,
530530
.jpegTrellisQuant = FALSE,
531531
.jpegOvershootDeringing = FALSE,
532532
.jpegOptimizeScans = FALSE,

vips/foreign.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ type SubsampleMode int
1919

2020
// SubsampleMode enum correlating to libvips subsample modes
2121
const (
22-
VipsForeignSubsampleAuto SubsampleMode = C.VIPS_FOREIGN_JPEG_SUBSAMPLE_AUTO
23-
VipsForeignSubsampleOn SubsampleMode = C.VIPS_FOREIGN_JPEG_SUBSAMPLE_ON
24-
VipsForeignSubsampleOff SubsampleMode = C.VIPS_FOREIGN_JPEG_SUBSAMPLE_OFF
25-
VipsForeignSubsampleLast SubsampleMode = C.VIPS_FOREIGN_JPEG_SUBSAMPLE_LAST
22+
VipsForeignSubsampleAuto SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_AUTO
23+
VipsForeignSubsampleOn SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_ON
24+
VipsForeignSubsampleOff SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_OFF
25+
VipsForeignSubsampleLast SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_LAST
2626
)
2727

2828
// ImageType represents an image type
@@ -358,7 +358,7 @@ func vipsSaveJPEGToBuffer(in *C.VipsImage, params JpegExportParams) ([]byte, err
358358
p.quality = C.int(params.Quality)
359359
p.interlace = C.int(boolToInt(params.Interlace))
360360
p.jpegOptimizeCoding = C.int(boolToInt(params.OptimizeCoding))
361-
p.jpegSubsample = C.VipsForeignJpegSubsample(params.SubsampleMode)
361+
p.jpegSubsample = C.VipsForeignSubsample(params.SubsampleMode)
362362
p.jpegTrellisQuant = C.int(boolToInt(params.TrellisQuant))
363363
p.jpegOvershootDeringing = C.int(boolToInt(params.OvershootDeringing))
364364
p.jpegOptimizeScans = C.int(boolToInt(params.OptimizeScans))
@@ -467,7 +467,7 @@ func vipsSaveJP2KToBuffer(in *C.VipsImage, params Jp2kExportParams) ([]byte, err
467467
p.jp2kLossless = C.int(boolToInt(params.Lossless))
468468
p.jp2kTileWidth = C.int(params.TileWidth)
469469
p.jp2kTileHeight = C.int(params.TileHeight)
470-
p.jpegSubsample = C.VipsForeignJpegSubsample(params.SubsampleMode)
470+
p.jpegSubsample = C.VipsForeignSubsample(params.SubsampleMode)
471471

472472
return vipsSaveToBuffer(p)
473473
}

vips/foreign.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ typedef struct SaveParams {
8484

8585
// JPEG
8686
BOOL jpegOptimizeCoding;
87-
VipsForeignJpegSubsample jpegSubsample;
87+
VipsForeignSubsample jpegSubsample;
8888
BOOL jpegTrellisQuant;
8989
BOOL jpegOvershootDeringing;
9090
BOOL jpegOptimizeScans;

0 commit comments

Comments
 (0)