This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit f756d91c315be6499a0453a71a0e371982dd8af9
Author: Kim Woelders <[email protected]>
AuthorDate: Thu Jun 30 09:01:26 2022 +0200
TIFF loader: Change default save compression type
As of libtiff 4.4.0 saving an image with COMPRESSION_DEFLATE will
produce a warning:
TIFFWriteDirectorySec: Warning, Creating TIFF with legacy Deflate codec identifier,
COMPRESSION_ADOBE_DEFLATE is more widely supported.
So let's just use COMPRESSION_ADOBE_DEFLATE.
---
src/modules/loaders/loader_tiff.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/modules/loaders/loader_tiff.c b/src/modules/loaders/loader_tiff.c
index a587f1c..e77dff3 100644
--- a/src/modules/loaders/loader_tiff.c
+++ b/src/modules/loaders/loader_tiff.c
@@ -466,12 +466,9 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
int x, y;
uint8_t r, g, b, a = 0;
int has_alpha = IM_FLAG_ISSET(im, F_HAS_ALPHA);
+ int compression_type;
int i;
-
- /* By default uses patent-free use COMPRESSION_DEFLATE,
- * another lossless compression technique */
ImlibImageTag *tag;
- int compression_type = COMPRESSION_DEFLATE;
tif = TIFFOpen(im->real_file, "w");
if (!tif)
@@ -494,12 +491,14 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
/* saver modules */
/* compression */
+ compression_type = COMPRESSION_ADOBE_DEFLATE;
tag = __imlib_GetTag(im, "compression_type");
if (tag)
{
- compression_type = tag->val;
- switch (compression_type)
+ switch (tag->val)
{
+ default:
+ break;
case COMPRESSION_NONE:
case COMPRESSION_CCITTRLE:
case COMPRESSION_CCITTFAX3:
@@ -523,11 +522,9 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
case COMPRESSION_JBIG:
case COMPRESSION_SGILOG:
case COMPRESSION_SGILOG24:
+ compression_type = tag->val;
break;
- default:
- compression_type = COMPRESSION_DEFLATE;
}
-
}
TIFFSetField(tif, TIFFTAG_COMPRESSION, compression_type);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.