Update to 4.1.0.

Also enable xz and zstd compression as proposed by landry@ eight months
ago.
Include an upstream fix for a new sanity check that broke OJPEG compression;
proposed by sthen@.

ok sthen@
This commit is contained in:
naddy 2019-11-29 16:43:01 +00:00
parent cc87d93273
commit 628803c84b
10 changed files with 144 additions and 24 deletions

View File

@ -1,29 +1,29 @@
# $OpenBSD: Makefile,v 1.89 2019/07/12 20:47:10 sthen Exp $
# $OpenBSD: Makefile,v 1.90 2019/11/29 16:43:01 naddy Exp $
COMMENT= tools and library routines for working with TIFF images
DISTNAME= tiff-4.0.10
SHARED_LIBS= tiff 40.3 # 9.0
SHARED_LIBS+= tiffxx 40.2 # 9.0
DISTNAME= tiff-4.1.0
SHARED_LIBS= tiff 40.4 # 10.0
SHARED_LIBS+= tiffxx 40.2 # 10.0
CATEGORIES= graphics
MASTER_SITES= https://download.osgeo.org/libtiff/
HOMEPAGE= http://www.simplesystems.org/libtiff/
LIB_DEPENDS= graphics/jpeg
WANTLIB= c m ${COMPILER_LIBCXX} z jpeg
LIB_DEPENDS= graphics/jpeg \
archivers/xz \
archivers/zstd
WANTLIB= c ${COMPILER_LIBCXX} jpeg lzma m z zstd
COMPILER = base-clang ports-gcc base-gcc
COMPILER = base-clang ports-gcc base-gcc
# BSD
PERMIT_PACKAGE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --disable-jbig \
--disable-lzma \
--disable-webp \
--disable-zstd \
--with-docdir="${PREFIX}/share/doc/tiff" \
--with-jpeg-include-dir="${LOCALBASE}/include" \
--with-jpeg-lib-dir="${LOCALBASE}/lib" \

View File

@ -1,2 +1,2 @@
SHA256 (tiff-4.0.10.tar.gz) = LFLRHMr3Z0V9sMRnldnH0ajY929osLgAo9/kV4a5luQ=
SIZE (tiff-4.0.10.tar.gz) = 2402867
SHA256 (tiff-4.1.0.tar.gz) = XSnzJRfa22280SVepbvJOitUuU+/g2U7TWXH1ndbhjQ=
SIZE (tiff-4.1.0.tar.gz) = 2421581

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-libtiff_tif_luv_c,v 1.8 2017/05/26 20:50:57 naddy Exp $
$OpenBSD: patch-libtiff_tif_luv_c,v 1.9 2019/11/29 16:43:01 naddy Exp $
Index: libtiff/tif_luv.c
--- libtiff/tif_luv.c.orig
+++ libtiff/tif_luv.c
@@ -744,7 +744,7 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, ui
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
(int)(x) : \
- (int)((x) + rand()*(1./RAND_MAX) - .5))
+ (int)((x) + arc4random()*(1./UINT_MAX) - .5))
@@ -748,7 +748,7 @@ static int itrunc(double x, int m)
return (int)x;
/* Silence CoverityScan warning about bad crypto function */
/* coverity[dont_call] */
- return (int)(x + rand()*(1./RAND_MAX) - .5);
+ return (int)(x + arc4random()*(1./UINT_MAX) - .5);
}
#if !LOGLUV_PUBLIC
static

View File

@ -0,0 +1,75 @@
$OpenBSD: patch-libtiff_tif_ojpeg_c,v 1.3 2019/11/29 16:43:01 naddy Exp $
OJPEG: fix broken sanity check added in 4.1.0
https://gitlab.com/libtiff/libtiff/commit/0356ea76bac908c61160d735f078437ace953bd3
Index: libtiff/tif_ojpeg.c
--- libtiff/tif_ojpeg.c.orig
+++ libtiff/tif_ojpeg.c
@@ -837,36 +837,6 @@ OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc)
{
if (sp->subsampling_convert_state==0)
{
- const jpeg_decompress_struct* cinfo = &sp->libjpeg_jpeg_decompress_struct;
- int width = 0;
- int last_col_width = 0;
- int jpeg_bytes;
- int expected_bytes;
- int i;
- if (cinfo->MCUs_per_row == 0)
- {
- sp->error_in_raw_data_decoding = 1;
- return 0;
- }
- for (i = 0; i < cinfo->comps_in_scan; ++i)
- {
- const jpeg_component_info* info = cinfo->cur_comp_info[i];
-#if JPEG_LIB_VERSION >= 70
- width += info->MCU_width * info->DCT_h_scaled_size;
- last_col_width += info->last_col_width * info->DCT_h_scaled_size;
-#else
- width += info->MCU_width * info->DCT_scaled_size;
- last_col_width += info->last_col_width * info->DCT_scaled_size;
-#endif
- }
- jpeg_bytes = (cinfo->MCUs_per_row - 1) * width + last_col_width;
- expected_bytes = sp->subsampling_convert_clinelenout * sp->subsampling_ver * sp->subsampling_hor;
- if (jpeg_bytes != expected_bytes)
- {
- TIFFErrorExt(tif->tif_clientdata,module,"Inconsistent number of MCU in codestream");
- sp->error_in_raw_data_decoding = 1;
- return(0);
- }
if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0)
{
sp->error_in_raw_data_decoding = 1;
@@ -1291,6 +1261,29 @@ OJPEGWriteHeaderInfo(TIFF* tif)
}
if (jpeg_start_decompress_encap(sp,&(sp->libjpeg_jpeg_decompress_struct))==0)
return(0);
+ if(sp->libjpeg_jpeg_decompress_struct.image_width != sp->strile_width ||
+ sp->libjpeg_jpeg_decompress_struct.image_height < sp->strile_length) {
+ TIFFErrorExt(tif->tif_clientdata,module,
+ "jpeg_start_decompress() returned image_width = %d "
+ "and image_height = %d, expected %d and %d",
+ sp->libjpeg_jpeg_decompress_struct.image_width,
+ sp->libjpeg_jpeg_decompress_struct.image_height,
+ sp->strile_width,
+ sp->strile_length);
+ return 0;
+ }
+ if(sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor != sp->subsampling_hor ||
+ sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor != sp->subsampling_ver) {
+ TIFFErrorExt(tif->tif_clientdata,module,
+ "jpeg_start_decompress() returned max_h_samp_factor = %d "
+ "and max_v_samp_factor = %d, expected %d and %d",
+ sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor,
+ sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor,
+ sp->subsampling_hor,
+ sp->subsampling_ver);
+ return 0;
+ }
+
sp->writeheader_done=1;
return(1);
}

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-test_Makefile_in,v 1.11 2018/12/05 20:35:25 naddy Exp $
$OpenBSD: patch-test_Makefile_in,v 1.12 2019/11/29 16:43:01 naddy Exp $
Avoid picking up an old libtiff in ${LOCALBASE}.
Index: test/Makefile.in
--- test/Makefile.in.orig
+++ test/Makefile.in
@@ -532,10 +532,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -549,10 +549,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-test_tiff2ps-EPS1_sh,v 1.1 2019/11/29 16:43:02 naddy Exp $
Index: test/tiff2ps-EPS1.sh
--- test/tiff2ps-EPS1.sh.orig
+++ test/tiff2ps-EPS1.sh
@@ -5,4 +5,4 @@
PSFILE=o-tiff2ps-EPS1.ps
. ${srcdir:-.}/common.sh
f_test_stdout "${TIFF2PS} -e -1" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
-diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
+diff -I '%%(CreationDate|Title):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-test_tiff2ps-PS1_sh,v 1.1 2019/11/29 16:43:02 naddy Exp $
Index: test/tiff2ps-PS1.sh
--- test/tiff2ps-PS1.sh.orig
+++ test/tiff2ps-PS1.sh
@@ -5,4 +5,4 @@
PSFILE="o-tiff2ps-PS1.ps"
. ${srcdir:-.}/common.sh
f_test_stdout "${TIFF2PS} -a -p -1" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
-diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
+diff -I '%%(CreationDate|Title):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-test_tiff2ps-PS2_sh,v 1.1 2019/11/29 16:43:02 naddy Exp $
Index: test/tiff2ps-PS2.sh
--- test/tiff2ps-PS2.sh.orig
+++ test/tiff2ps-PS2.sh
@@ -5,4 +5,4 @@
PSFILE=o-tiff2ps-PS2.ps
. ${srcdir:-.}/common.sh
f_test_stdout "${TIFF2PS} -a -p -2" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
-diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
+diff -I '%%(CreationDate|Title):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-test_tiff2ps-PS3_sh,v 1.1 2019/11/29 16:43:02 naddy Exp $
Index: test/tiff2ps-PS3.sh
--- test/tiff2ps-PS3.sh.orig
+++ test/tiff2ps-PS3.sh
@@ -5,4 +5,4 @@
PSFILE=o-tiff2ps-PS3.ps
. ${srcdir:-.}/common.sh
f_test_stdout "${TIFF2PS} -a -p -3" "${IMG_MINISWHITE_1C_1B}" "${PSFILE}"
-diff -I '%%\(CreationDate\|Title\):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1
+diff -I '%%(CreationDate|Title):*' -u "${REFS}/${PSFILE}" "${PSFILE}" || exit 1

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.27 2018/12/05 20:35:25 naddy Exp $
@comment $OpenBSD: PLIST,v 1.28 2019/11/29 16:43:02 naddy Exp $
@bin bin/fax2ps
@bin bin/fax2tiff
@bin bin/pal2rgb
@ -22,10 +22,10 @@ include/tiffconf.h
include/tiffio.h
include/tiffio.hxx
include/tiffvers.h
lib/libtiff.a
@static-lib lib/libtiff.a
lib/libtiff.la
@lib lib/libtiff.so.${LIBtiff_VERSION}
lib/libtiffxx.a
@static-lib lib/libtiffxx.a
lib/libtiffxx.la
@lib lib/libtiffxx.so.${LIBtiffxx_VERSION}
lib/pkgconfig/libtiff-4.pc
@ -242,3 +242,4 @@ share/doc/tiff/v4.0.6.html
share/doc/tiff/v4.0.7.html
share/doc/tiff/v4.0.8.html
share/doc/tiff/v4.0.9.html
share/doc/tiff/v4.1.0.html