Commit Graph

693 Commits

Author SHA1 Message Date
Thomas Bernard
98a254f5b9 enforce (configurable) memory limit in tiff2rgba
fixes #207
fixes #209
2020-11-15 17:02:51 +01:00
Even Rouault
dadd8c7dce Merge branch 'issue-220' into 'master'
tiff2pdf.c: properly calculate datasize when saving to JPEG YCbCr

Closes #220

See merge request libtiff/libtiff!159
2020-11-14 12:53:01 +00:00
Thomas Bernard
7be2e452dd tiff2pdf.c: properly calculate datasize when saving to JPEG YCbCr
fixes #220
2020-11-14 12:53:01 +00:00
Even Rouault
bf84e70665 Merge branch 'issue-204' into 'master'
avoid buffer overflow while writing jpeg end of file marker

Closes #204

See merge request libtiff/libtiff!161
2020-11-14 12:51:06 +00:00
Thomas Bernard
b7cc4f7ef1
tiff2ps.c: fix buffer overread
fixes #193
2020-11-10 03:00:27 +01:00
Thomas Bernard
19ff8a6e97
fix undefined behaviour (int shifted too much to the left) 2020-11-10 03:00:12 +01:00
Thomas Bernard
a61c255236
avoid buffer overflow while writing jpeg end of file marker
fixes #204
2020-11-10 02:35:53 +01:00
Even Rouault
3a2de853a9
Add support for optional building against libdeflate for faster Zip/Deflate compression/decompression.
So we can have 2 kind of builds with the Zip/Deflate codec:
- zlib only
- zlib + libdeflate

Speed improvements in the 35%-50% range can be expected when libdeflate is used.
Compression level up to 12 is now supported (capped to 9 when zlib is used).
Still requires zlib for situations where libdeflate cannot be used (that
is for scanline access, since libdeflate has no streaming mode)

Pseudo-tag TIFFTAG_DEFLATE_SUBCODEC=DEFLATE_SUBCODEC_ZLIB/DEFLATE_SUBCODEC_LIBDEFLATE
is added to control which subcodec (zlib or libdeflate) should be used (it defaults
of course to libdeflate, when it is available).
This is mostly aimed at being used on the writing side, to be able to reproduce
output of previous libtiff versions at a binary level, in situations where this would
be really needed. Or as a safety belt in case there would be unforeseen issues
with using libdeflate.
It can be used to know when libdeflate is available at runtime (DEFLATE_SUBCODEC_LIBDEFLATE
will be the default value in that situation).

Of course, deflate codestreams produced by libdeflate can be read by zlib, and vice-versa.
2020-10-16 13:40:10 +02:00
Even Rouault
8c4c297a48 Merge branch 'shared-memory' into 'master'
Set the --shared-memory linker flag for Emscripten builds

See merge request libtiff/libtiff!153
2020-10-04 09:51:13 +00:00
Even Rouault
ca70b5e702
tiff2rgba.c: fix -Wold-style-declaration warning 2020-10-03 18:16:27 +02:00
Attila Oláh
433e052356
Set the --shared-memory linker flag for Emscripten builds.
This is only needed when building with WEBP support, which uses atomics,
therefore the linker needs the --shared-memory flag. The flag cannot be
added globally because not all executables link against libwebp.
2020-09-24 16:22:25 +00:00
Thomas Bernard
aea167005f
tiffsplit: use EXIT_SUCCESS / EXIT_FAILURE 2020-04-26 22:15:09 +02:00
Thomas Bernard
2fa1ce2f55
tiffset: print usage on stdout when -h is used
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard
9bf9cd3926
tiffmedian: shopw usage on stdout when -h is used
aslo use EXIT_SUCCESS/EXIT_FAILURE
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard
1c614e2686
tiffinfo: print usage on stdout when -h is used
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:09 +02:00
Thomas Bernard
46c8624972
raw2tiff: print usage to stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard
ee6cf2f59d
tiff2pdf: print usage on stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard
2c6e8805ba
tiffgt: output usage on stdout with -h
also use EXIT_SUCCESS / EXIT_FAILURE
2020-04-26 22:15:08 +02:00
Thomas Bernard
eb6806dd64
tiffdump: use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard
68564877c7
tiffdither: print usage on stdout when -h is used
see #17
2020-04-26 22:15:08 +02:00
Thomas Bernard
08b99340ee
tiffcrop: -h / -v prints usage/version to stdout
also uses the standard C EXIT_SUCCESS / EXIT_FAILURE
macros

see #17
2020-04-26 22:15:05 +02:00
Thomas Bernard
2b2b1fd8fe
tiffcp: output usage to stdout when using -h
also use EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:13:28 +02:00
Thomas Bernard
5e0eb5bbf4
tiffcmp: match exit status for posix cmp and diff tools 2020-04-26 22:11:36 +02:00
Thomas Bernard
02875964eb
tiff2rgba: output usage to stdout when using -h
also uses std C EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:11:36 +02:00
Thomas Bernard
05993b6408
tiff2ps: sue EXIT_FAILURE / EXIT_SUCCESS
see #17
2020-04-26 22:11:36 +02:00
Thomas Bernard
ff18e43223
tiff2bw: output usage on stdout when using -h
also uses EXIT_SUCCESS / EXIT_FAILURE
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
da2995eecf
thumbnail: use EXIT_FAILURE / EXIT_SUCCESS
the -h option was already used so it cannot be used for help/usage
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
aa4409eda5
rgb2ycbcr: use EXIT_FAILURE / EXIT_SUCCESS
the -h option was already used so it cannot be used for help/usage
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
113a07e9f3
ppm2tiff: output usage to stdout when using -h option
also uses std C EXIT_SUCCESS / EXIT_FAILURE
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
3ac0c950c6
pal2rgb: output usage to stdout when -h is used
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
04e7c51f4e
fax2tiff.c: print usage on stdout when using -h option
see #17
2020-04-26 22:11:35 +02:00
Thomas Bernard
0aed3363cf
fax2ps: output usage to stdout when using -h option
also use EXIT_SUCCESS, EXIT_FAILURE from C standard
2020-04-26 22:11:34 +02:00
Thomas Bernard
f840b0d2ba
tiff2pdf: test the return code of TIFFReadRawStrip() and TIFFReadRawTile() 2020-04-19 23:39:59 +02:00
Thomas Bernard
8fed45347e
tiff2pdf.c: fix some whitespace problems in source 2020-04-19 20:55:05 +02:00
Thomas Bernard
bb1ab756d6
tiff2pdf: get rid of uninitialized memory content
fixes #176
2020-04-19 20:55:05 +02:00
Even Rouault
1b4708f67f Merge branch 'issue-18' into 'master'
tiffset: pass size for TIFFTAG_INKNAMES

Closes #18

See merge request libtiff/libtiff!146
2020-04-19 18:32:25 +00:00
Thomas Bernard
4b64bf1cee
tiffset: pass size for TIFFTAG_INKNAMES
Uses TIFFFieldPassCount() to know which arguments need to be
passed to TiffSetField()

fixes #18
see http://bugzilla.maptools.org/show_bug.cgi?id=2202
2020-04-05 19:33:02 +02:00
Thomas Bernard
aa9d52ac2b
tiffinfo: showdata for tiled images 2020-04-05 01:19:10 +02:00
Thomas Bernard
691427ea8d
tiffinfo: fix dump of Tiled images
fixes #80
2020-04-05 00:46:12 +02:00
Thomas Bernard
1f3e801d96 tiffcrop: enforce memory allocation limit
uses -k option to change limit (default to 256MiB)
fixes #117 / http://bugzilla.maptools.org/show_bug.cgi?id=2757
2020-04-03 19:11:09 +00:00
Thomas Bernard
e526f620ef
tiffcp: disable strip chopping when trying to convert to JBIG compression
fixes #45
2020-04-02 01:18:10 +02:00
Thomas Bernard
4efb92d1c9
tiff2pdf: fix "raw" copy of Deflate streams
The Predictor parametter was not copied from the source tiff to the PDF.
fixes #48 / http://bugzilla.maptools.org/show_bug.cgi?id=2442
2020-03-27 22:34:37 +01:00
Even Rouault
ed881da0db Merge branch 'issue-143-144' into 'master'
tiffdump: avoid unaligned memory access

Closes #144 et #143

See merge request libtiff/libtiff!133
2020-03-24 12:39:48 +00:00
Even Rouault
3c47638aaa Merge branch 'issue-133' into 'master'
tiff2pdf: avoid divide by 0

Closes #133

See merge request libtiff/libtiff!126
2020-03-24 12:39:18 +00:00
Thomas Bernard
bd49c5810f
tiff2pdf: normalizePoint() macro to normalize the white point 2020-03-24 11:34:36 +01:00
Thomas Bernard
37121e1574
tiffdump: avoid unaligned memory access
fixes #143
fixes #144
2020-03-24 00:18:32 +01:00
Even Rouault
6c63f17749 Merge branch 'out-of-memory' into 'master'
tiffcp/tiff2pdf/tiff2ps: enforce maximum malloc size

Closes #153, #84, #116 et #115

See merge request libtiff/libtiff!130
2020-03-23 18:11:02 +00:00
Thomas Bernard
b738aaa834
tiffset: check memory allocation
fixes #157 / http://bugzilla.maptools.org/show_bug.cgi?id=2850
2020-03-23 17:17:17 +01:00
Thomas Bernard
dff30c4d5d
tiff2ps: enforce memory allocation limit
fixes #153 / http://bugzilla.maptools.org/show_bug.cgi?id=2845
2020-03-21 15:50:38 +01:00
Thomas Bernard
791046b3c6
tiff2pdf: enforce maximum data size
fixes #116 / http://bugzilla.maptools.org/show_bug.cgi?id=2756
fixes #84 / http://bugzilla.maptools.org/show_bug.cgi?id=2683
2020-03-21 15:30:43 +01:00