Skip to content

Commit 7c64776

Browse files
je4Juergen Enge
andauthored
TIFF Export Params are exposing additional values for export of tiled and/or pyramidal tiff files. (#454)
Pyramid, Tile, TileHeight, TileWidth are exposed to go interface Co-authored-by: Juergen Enge <[email protected]>
1 parent 4188b98 commit 7c64776

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

vips/foreign.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ func vipsSaveTIFFToBuffer(in *C.VipsImage, params TiffExportParams) ([]byte, err
414414
p.stripMetadata = C.int(boolToInt(params.StripMetadata))
415415
p.quality = C.int(params.Quality)
416416
p.tiffCompression = C.VipsForeignTiffCompression(params.Compression)
417+
p.tiffPyramid = C.int(boolToInt(params.Pyramid))
418+
p.tiffTile = C.int(boolToInt(params.Tile))
419+
p.tiffTileHeight = C.int(params.TileHeight)
420+
p.tiffTileWidth = C.int(params.TileWidth)
417421

418422
return vipsSaveToBuffer(p)
419423
}

vips/image.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ type TiffExportParams struct {
306306
Quality int
307307
Compression TiffCompression
308308
Predictor TiffPredictor
309+
Pyramid bool
310+
Tile bool
311+
TileHeight int
312+
TileWidth int
309313
}
310314

311315
// NewTiffExportParams creates default values for an export of a TIFF image.
@@ -314,6 +318,10 @@ func NewTiffExportParams() *TiffExportParams {
314318
Quality: 80,
315319
Compression: TiffCompressionLzw,
316320
Predictor: TiffPredictorHorizontal,
321+
Pyramid: false,
322+
Tile: false,
323+
TileHeight: 256,
324+
TileWidth: 256,
317325
}
318326
}
319327

0 commit comments

Comments
 (0)