We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
I try to re-compress an image in zip with --predictor set to horizontal as in
--predictor
horizontal
vips tiffsave GitHub-Mark.png vips_horizontal.tif --compression deflate --predictor horizontal
but it's seems to be ignored in the output image:
$ tiffinfo vips_horizontal.tif TIFF Directory at offset 0x3b3c (15164) Image Width: 560 Image Length: 560 Resolution: 28.34, 28.34 pixels/cm Bits/Sample: 8 Sample Format: unsigned integer Compression Scheme: AdobeDeflate Photometric Interpretation: RGB color Orientation: row 0 top, col 0 lhs Samples/Pixel: 3 Rows/Strip: 128 Planar Configuration: single image plane
And no matter --predictor horizontal or --predictor none, they output the same file size, as if they were compressed without setting a predictor.
--predictor horizontal
--predictor none
To Reproduce
Steps to reproduce the behavior:
tiffinfo vips_horizontal.tif
vips tiffsave GitHub-Mark.png vips_none.tif --compression deflate --predictor none
Expected behavior
Predictor: horizontal differencing 2 (0x2)
tiffinfo
Actual behavior
Environment
Linux 5.11.2-arch1-1
$ pacman -Q libtiff libvips imagemagick libtiff 4.2.0-1 libvips 8.10.3-1 imagemagick 7.0.11.2-1
Additional context
As a comparison, use ImageMagick:
magick convert GitHub-Mark.png -compress zip -define tiff:predictor=2 gm_horizontal.tif
Could see the Predictor filed is set,
Predictor
$ tiffinfo gm_horizontal.tif TIFF Directory at offset 0x2494 (9364) Image Width: 560 Image Length: 560 Bits/Sample: 8 Compression Scheme: AdobeDeflate Photometric Interpretation: palette color (RGB from colormap) FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 560 Planar Configuration: single image plane Page Number: 0-1 Color Map: (present) White Point: 0.3127-0.329 PrimaryChromaticities: 0.640000,0.330000,0.300000,0.600000,0.150000,0.060000 Predictor: horizontal differencing 2 (0x2)
And the generated image sizes are different: (with respect to -define tiff:predictor=1)
-define tiff:predictor=1
$ ls -l gm_horizontal.tif gm_none.tif -rw-r--r-- 1 adios adios 11174 Mar 4 04:18 gm_horizontal.tif -rw-r--r-- 1 adios adios 9892 Mar 4 04:29 gm_none.tif
Additional context 2
I encountered this issue on Ubuntu (with homebrew) at beginning, and then I started a VM to install Arch to test and report the issue.
The text was updated successfully, but these errors were encountered:
Hi @Adios, you're right, there was a mixup in enum values in the tiff saver which prevented it from setting the predictor correctly.
I now see:
$ vips tiffsave k2.jpg x.tif --compression deflate --predictor horizontal $ tiffinfo x.tif TIFF Directory at offset 0x38fa56 (3734102) Image Width: 1450 Image Length: 2048 Resolution: 72.009, 72.009 pixels/inch Bits/Sample: 8 Sample Format: unsigned integer Compression Scheme: AdobeDeflate Photometric Interpretation: RGB color Orientation: row 0 top, col 0 lhs Samples/Pixel: 3 Rows/Strip: 128 Planar Configuration: single image plane Predictor: horizontal differencing 2 (0x2)
This fix will be in 8.10.6, and I've credited you in the changelog.
Thank you very much for reporting this dumb thing!
Sorry, something went wrong.
fix tiff deflate predictor setting
86a6fd9
the enums were mixed up, thanks Adios see #2128
No branches or pull requests
Bug report
Describe the bug
I try to re-compress an image in zip with
--predictor
set tohorizontal
as inbut it's seems to be ignored in the output image:
And no matter
--predictor horizontal
or--predictor none
, they output the same file size, as if they were compressed without setting a predictor.To Reproduce
Steps to reproduce the behavior:
vips tiffsave GitHub-Mark.png vips_horizontal.tif --compression deflate --predictor horizontal
tiffinfo vips_horizontal.tif
vips tiffsave GitHub-Mark.png vips_none.tif --compression deflate --predictor none
Expected behavior
Predictor: horizontal differencing 2 (0x2)
in thetiffinfo
outputActual behavior
Predictor: horizontal differencing 2 (0x2)
in thetiffinfo
outputEnvironment
Linux 5.11.2-arch1-1
Additional context
As a comparison, use ImageMagick:
Could see the
Predictor
filed is set,And the generated image sizes are different: (with respect to
-define tiff:predictor=1
)Additional context 2
I encountered this issue on Ubuntu (with homebrew) at beginning, and then I started a VM to install Arch to test and report the issue.
The text was updated successfully, but these errors were encountered: