Skip to content

Commit

Permalink
TIFF Export Params are exposing additional values for export of tiled…
Browse files Browse the repository at this point in the history
… and/or pyramidal tiff files. (#454)

Pyramid, Tile, TileHeight, TileWidth are exposed to go interface

Co-authored-by: Juergen Enge <[email protected]>
  • Loading branch information
je4 and Juergen Enge authored Dec 14, 2024
1 parent 4188b98 commit 7c64776
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vips/foreign.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ func vipsSaveTIFFToBuffer(in *C.VipsImage, params TiffExportParams) ([]byte, err
p.stripMetadata = C.int(boolToInt(params.StripMetadata))
p.quality = C.int(params.Quality)
p.tiffCompression = C.VipsForeignTiffCompression(params.Compression)
p.tiffPyramid = C.int(boolToInt(params.Pyramid))
p.tiffTile = C.int(boolToInt(params.Tile))
p.tiffTileHeight = C.int(params.TileHeight)
p.tiffTileWidth = C.int(params.TileWidth)

return vipsSaveToBuffer(p)
}
Expand Down
8 changes: 8 additions & 0 deletions vips/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ type TiffExportParams struct {
Quality int
Compression TiffCompression
Predictor TiffPredictor
Pyramid bool
Tile bool
TileHeight int
TileWidth int
}

// NewTiffExportParams creates default values for an export of a TIFF image.
Expand All @@ -314,6 +318,10 @@ func NewTiffExportParams() *TiffExportParams {
Quality: 80,
Compression: TiffCompressionLzw,
Predictor: TiffPredictorHorizontal,
Pyramid: false,
Tile: false,
TileHeight: 256,
TileWidth: 256,
}
}

Expand Down

0 comments on commit 7c64776

Please sign in to comment.