TIFFGETMAXCOMPRESSIONRATIO(3tiff)
β¨ TIFFGETMAXCOMPRESSIONRATIO β¨
okay bestie, welcome to the tiffio.h cinematic universe π this one is from LibTIFF, and it's called TIFFGetMaxCompressionRatio β she's here to hand you the maximum compression ratio for the current codec. slay.
π psst β she's a newer girlie, added in version 4.7.2.
πΈ SYNOPSIS πΈ
#include <tiffio.h>
uint64_t TIFFGetMaxCompressionRatio(TIFF *tif);
like, that's it. one function. one pointer. one uint64_t. iconic behavior fr fr π
π« DESCRIPTION π«
so TIFFGetMaxCompressionRatio() returns the maximum compression ratio for the current codec. and the vibe is: this ratio is typically achieved for an uncompressed buffer with all bytes at zero. like, the most boring possible data, and the codec just goes feral on it π¦
the way you'd actually use this? it's a reality check. you can use it to figure out whether the compressed size of a strip or tile is realistic compared to the expected uncompressed size β which, and this is the important part, helps prevent some denial-of-service scenarios. no cap. it's a security girlie.
and depending on the codec, she might also take into account the strip or tile size, the number of samples per pixel, etc. every codec gets to have its own little opinions π
now the honest part, ngl: some codecs don't implement that method, or they only do it for a subset of configurations β and those may return 0 when the maximum compression ratio is unknown. not a bug, just them being mysterious π
π₯ RETURN VALUES π₯
0β returned if no maximum compression ratio is known. mystery codec. no info. π1β returned when there is no compression.- values strictly bigger than
1β returned when a maximum compression ratio is known. she ate π
π AUTHOR π
LibTIFF contributors
π COPYRIGHT π
1988-2025, LibTIFF contributors
π and that's the whole page, bestie. TIFFGetMaxCompressionRatio, LibTIFF, version 4.7, dated Jun 27, 2026 β go forth and vibe check your compression ratios πβ¨π«Ά
π¦ where this page comes from
- fedora 43: libtiff-devel 4.7.2-1.fc43
- fedora 43: libtiff-devel 4.7.2-1.fc43
- fedora 43: libtiff-devel 4.7.2-3.fc43 Β· libtiff
- fedora 43: libtiff-devel 4.7.2-3.fc43 Β· libtiff
- fedora 44: libtiff-devel 4.7.2-1.fc44
- fedora 44: libtiff-devel 4.7.2-1.fc44
- fedora 44: libtiff-devel 4.7.2-3.fc44 Β· libtiff
- fedora 44: libtiff-devel 4.7.2-3.fc44 Β· libtiff
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms