Compare commits

...

No commits in common. "c8s" and "c10s" have entirely different histories.
c8s ... c10s

10 changed files with 359 additions and 9 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/tiff-3.9.4.tar.gz
/tiff-3.9.4.tar.gz /tiff-3.9.4.tar.gz

View File

@ -1,7 +1,7 @@
Summary: Compatibility package for libtiff 3 Summary: Compatibility package for libtiff 3
Name: compat-libtiff3 Name: compat-libtiff3
Version: 3.9.4 Version: 3.9.4
Release: 13%{?dist} Release: 15%{?dist}
License: libtiff License: libtiff
Group: System Environment/Libraries Group: System Environment/Libraries
@ -42,6 +42,7 @@ Patch34: libtiff-coverity.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: zlib-devel libjpeg-devel BuildRequires: zlib-devel libjpeg-devel
BuildRequires: libtool automake autoconf BuildRequires: libtool automake autoconf
BuildRequires: gcc-g++
%global LIBVER %(echo %{version} | cut -f 1-2 -d .) %global LIBVER %(echo %{version} | cut -f 1-2 -d .)
@ -128,10 +129,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libtiffxx.so.* %{_libdir}/libtiffxx.so.*
%changelog %changelog
* Wed Jun 12 2019 Nikola Forró <nforro@redhat.com> - 3.9.4-13 * Wed Sep 08 2021 Nikola Forró <nforro@redhat.com> - 3.9.4-15
- Fix important Covscan defects - Rebuild to fix synchronization with RHEL
related: #1687584 related: #1990361
* Thu Jun 06 2019 Nikola Forró <nforro@redhat.com> - 3.9.4-12 * Mon Feb 22 2021 Nikola Forró <nforro@redhat.com> - 3.9.4-14
- New package for RHEL 8.1.0 - Initial package for RHEL 9
resolves: #1687584

View File

@ -1,6 +1,6 @@
--- !Policy --- !Policy
product_versions: product_versions:
- rhel-8 - rhel-9
decision_context: osci_compose_gate decision_context: osci_compose_gate
rules: rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

31
libtiff-am-version.patch Normal file
View File

@ -0,0 +1,31 @@
Back off the minimum required automake version to 1.11. There isn't
anything in libtiff currently that actually requires 1.12, and changing
this allows the package to be built on pre-F18 machines for easier testing.
This patch can go away once we no longer care about testing on pre-F18.
diff -Naur tiff-4.0.3.orig/Makefile.am tiff-4.0.3/Makefile.am
--- tiff-4.0.3.orig/Makefile.am 2012-09-20 09:22:47.000000000 -0400
+++ tiff-4.0.3/Makefile.am 2012-10-30 11:33:30.312823564 -0400
@@ -25,7 +25,7 @@
docdir = $(LIBTIFF_DOCDIR)
-AUTOMAKE_OPTIONS = 1.12 dist-zip foreign
+AUTOMAKE_OPTIONS = 1.11 dist-zip foreign
ACLOCAL_AMFLAGS = -I m4
docfiles = \
diff -Naur tiff-4.0.3.orig/test/Makefile.am tiff-4.0.3/test/Makefile.am
--- tiff-4.0.3.orig/test/Makefile.am 2012-09-20 09:22:28.000000000 -0400
+++ tiff-4.0.3/test/Makefile.am 2012-10-30 11:33:17.109696812 -0400
@@ -23,7 +23,7 @@
# Process this file with automake to produce Makefile.in.
-AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign
+AUTOMAKE_OPTIONS = 1.11 color-tests parallel-tests foreign
LIBTIFF = $(top_builddir)/libtiff/libtiff.la

122
libtiff-jpeg-test.patch Normal file
View File

@ -0,0 +1,122 @@
Back-port upstream patch to avoid assuming quite so much about what libjpeg
will return. Needed because libjpeg-turbo with the jpeg8 API broke the
expectations of the previous coding.
diff -Naur tiff-4.0.3.orig/test/raw_decode.c tiff-4.0.3/test/raw_decode.c
--- tiff-4.0.3.orig/test/raw_decode.c 2012-07-06 13:05:16.000000000 -0400
+++ tiff-4.0.3/test/raw_decode.c 2012-12-19 13:04:37.609738276 -0500
@@ -71,33 +71,54 @@
return 1;
}
-static int check_rgb_pixel( int pixel, int red, int green, int blue, unsigned char *buffer ) {
+static int check_rgb_pixel( int pixel,
+ int min_red, int max_red,
+ int min_green, int max_green,
+ int min_blue, int max_blue,
+ unsigned char *buffer ) {
unsigned char *rgb = buffer + 3 * pixel;
- if( rgb[0] == red && rgb[1] == green && rgb[2] == blue ) {
+ if( rgb[0] >= min_red && rgb[0] <= max_red &&
+ rgb[1] >= min_green && rgb[1] <= max_green &&
+ rgb[2] >= min_blue && rgb[2] <= max_blue ) {
return 0;
}
fprintf( stderr, "Pixel %d did not match expected results.\n", pixel );
- fprintf( stderr, "Expect: %3d %3d %3d\n", red, green, blue );
- fprintf( stderr, " Got: %3d %3d %3d\n", rgb[0], rgb[1], rgb[2] );
+ fprintf( stderr, "Got R=%d (expected %d..%d), G=%d (expected %d..%d), B=%d (expected %d..%d)\n",
+ rgb[0], min_red, max_red,
+ rgb[1], min_green, max_green,
+ rgb[2], min_blue, max_blue );
return 1;
}
-static int check_rgba_pixel( int pixel, int red, int green, int blue, int alpha, uint32 *buffer ) {
+static int check_rgba_pixel( int pixel,
+ int min_red, int max_red,
+ int min_green, int max_green,
+ int min_blue, int max_blue,
+ int min_alpha, int max_alpha,
+ uint32 *buffer ) {
/* RGBA images are upside down - adjust for normal ordering */
int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128;
uint32 rgba = buffer[adjusted_pixel];
- if( TIFFGetR(rgba) == (uint32) red && TIFFGetG(rgba) == (uint32) green &&
- TIFFGetB(rgba) == (uint32) blue && TIFFGetA(rgba) == (uint32) alpha ) {
+ if( TIFFGetR(rgba) >= (uint32) min_red &&
+ TIFFGetR(rgba) <= (uint32) max_red &&
+ TIFFGetG(rgba) >= (uint32) min_green &&
+ TIFFGetG(rgba) <= (uint32) max_green &&
+ TIFFGetB(rgba) >= (uint32) min_blue &&
+ TIFFGetB(rgba) <= (uint32) max_blue &&
+ TIFFGetA(rgba) >= (uint32) min_alpha &&
+ TIFFGetA(rgba) <= (uint32) max_alpha ) {
return 0;
}
fprintf( stderr, "Pixel %d did not match expected results.\n", pixel );
- fprintf( stderr, "Expect: %3d %3d %3d %3d\n", red, green, blue, alpha );
- fprintf( stderr, " Got: %3d %3d %3d %3d\n",
- TIFFGetR(rgba), TIFFGetG(rgba), TIFFGetB(rgba), TIFFGetA(rgba) );
+ fprintf( stderr, "Got R=%d (expected %d..%d), G=%d (expected %d..%d), B=%d (expected %d..%d), A=%d (expected %d..%d)\n",
+ TIFFGetR(rgba), min_red, max_red,
+ TIFFGetG(rgba), min_green, max_green,
+ TIFFGetB(rgba), min_blue, max_blue,
+ TIFFGetA(rgba), min_alpha, max_alpha );
return 1;
}
@@ -191,15 +212,17 @@
return 1;
}
-#if JPEG_LIB_VERSION >= 70
- pixel_status |= check_rgb_pixel( 0, 18, 0, 41, buffer );
- pixel_status |= check_rgb_pixel( 64, 0, 0, 0, buffer );
- pixel_status |= check_rgb_pixel( 512, 5, 34, 196, buffer );
-#else
- pixel_status |= check_rgb_pixel( 0, 15, 0, 18, buffer );
- pixel_status |= check_rgb_pixel( 64, 0, 0, 2, buffer );
- pixel_status |= check_rgb_pixel( 512, 6, 36, 182, buffer );
-#endif
+ /*
+ * JPEG decoding is inherently inexact, so we can't test for exact
+ * pixel values. (Well, if we knew exactly which libjpeg version
+ * we were using, and with what settings, we could expect specific
+ * values ... but it's not worth the trouble to keep track of.)
+ * Hence, use ranges of expected values. The ranges may need to be
+ * widened over time as more versions of libjpeg appear.
+ */
+ pixel_status |= check_rgb_pixel( 0, 15, 18, 0, 0, 18, 41, buffer );
+ pixel_status |= check_rgb_pixel( 64, 0, 0, 0, 0, 0, 2, buffer );
+ pixel_status |= check_rgb_pixel( 512, 5, 6, 34, 36, 182, 196, buffer );
free( buffer );
@@ -224,15 +247,12 @@
* accomplish it from the YCbCr subsampled buffer ourselves in which
* case the results may be subtly different but similar.
*/
-#if JPEG_LIB_VERSION >= 70
- pixel_status |= check_rgba_pixel( 0, 18, 0, 41, 255, rgba_buffer );
- pixel_status |= check_rgba_pixel( 64, 0, 0, 0, 255, rgba_buffer );
- pixel_status |= check_rgba_pixel( 512, 5, 34, 196, 255, rgba_buffer );
-#else
- pixel_status |= check_rgba_pixel( 0, 15, 0, 18, 255, rgba_buffer );
- pixel_status |= check_rgba_pixel( 64, 0, 0, 2, 255, rgba_buffer );
- pixel_status |= check_rgba_pixel( 512, 6, 36, 182, 255, rgba_buffer );
-#endif
+ pixel_status |= check_rgba_pixel( 0, 15, 18, 0, 0, 18, 41, 255, 255,
+ rgba_buffer );
+ pixel_status |= check_rgba_pixel( 64, 0, 0, 0, 0, 0, 2, 255, 255,
+ rgba_buffer );
+ pixel_status |= check_rgba_pixel( 512, 5, 6, 34, 36, 182, 196, 255, 255,
+ rgba_buffer );
free( rgba_buffer );
TIFFClose(tif);

26
libtiff-make-check.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/html/man/Makefile.am b/html/man/Makefile.am
index ca222de..c7421ac 100644
--- a/html/man/Makefile.am
+++ b/html/man/Makefile.am
@@ -85,7 +85,6 @@ docfiles = \
ras2tiff.1.html \
raw2tiff.1.html \
rgb2ycbcr.1.html \
- sgi2tiff.1.html \
thumbnail.1.html \
tiff2bw.1.html \
tiff2pdf.1.html \
@@ -96,12 +95,10 @@ docfiles = \
tiffcrop.1.html \
tiffdither.1.html \
tiffdump.1.html \
- tiffgt.1.html \
tiffinfo.1.html \
tiffmedian.1.html \
tiffset.1.html \
- tiffsplit.1.html \
- tiffsv.1.html
+ tiffsplit.1.html
dist_doc_DATA = $(indexfile) $(docfiles)

View File

@ -0,0 +1,119 @@
diff --git a/man/tiff2ps.1 b/man/tiff2ps.1
index c3a9bac..a826ad7 100644
--- a/man/tiff2ps.1
+++ b/man/tiff2ps.1
@@ -100,6 +100,9 @@ Generate \*(Ps Level 2.
Generate \*(Ps Level 3. It basically allows one to use the /flateDecode
filter for ZIP compressed TIFF images.
.TP
+.B \-8
+Disable use of ASCII85 encoding with PostScript Level 2/3
+.TP
.B \-a
Generate output for all IFDs (pages) in the input file.
.TP
@@ -123,6 +126,9 @@ directory to the specified directory number.
This option is useful for selecting individual pages in a
multi-page (e.g. facsimile) file.
.TP
+.B \-D
+Enable duplex printing (two pages per sheet of paper)
+.TP
.B \-e
Force the generation of Encapsulated \*(Ps (implies
.BR \-z ).
@@ -185,6 +191,10 @@ like which are hidden using the
.I SubIFD
tag.
.TP
+.B \-O
+Write PostScript to specified file instead of standard output
+Set the initial
+.TP
.B \-p
Force the generation of (non-Encapsulated) \*(Ps.
.TP
@@ -188,6 +188,9 @@ Set the initial
.B \-p
Force the generation of (non-Encapsulated) \*(Ps.
.TP
+.B \-P
+Set optional PageOrientation DSC comment to Landscape or Portrait.
+.TP
.B \-r 90|180|270|auto
Rotate image by 90, 180, 270 degrees or auto. Auto picks the best
fit for the image on the specified paper size (eg portrait
@@ -197,6 +207,12 @@ counterclockwise. Auto rotates 90 degrees ccw to produce landscape.
.B \-s
Generate output for a single IFD (page) in the input file.
.TP
+.B \-t
+Specify the document title string
+.TP
+.B \-T
+Print pages for top edge binding
+.TP
.B \-w
Specify the horizontal size of the printed area (in inches).
.TP
diff --git a/man/tiffcp.1 b/man/tiffcp.1
index 5fdcc47..bf50130 100644
--- a/man/tiffcp.1
+++ b/man/tiffcp.1
@@ -60,6 +60,9 @@ in a file, but it is explicitly intended to not alter or convert
the image data content in any way.
.SH OPTIONS
.TP
+.BI \-a
+Append to an existing output file instead of overwriting it
+.TP
.BI \-b " image"
subtract the following monochrome image from all others
processed. This can be used to remove a noise bias
@@ -179,6 +182,9 @@ overwritten and not when it is appended to.
.B \-M
Suppress the use of memory-mapped files when reading images.
.TP
+.BI \-o " offset"
+Set initial directory offset
+.TP
.B \-p
Specify the planar configuration to use in writing image data
that has one 8-bit sample per pixel.
@@ -228,6 +228,9 @@ appear in a tile.
.B \-x
Force the output file to be written with PAGENUMBER value in sequence.
.TP
+.B \-8
+Write BigTIFF instead of classic TIFF format.
+.TP
.BI \-,= character
substitute
.I character
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
index 0f81b19..8c696db 100644
--- a/tools/tiffcp.c
+++ b/tools/tiffcp.c
@@ -409,6 +409,10 @@ char* stuff[] = {
" -s write output in strips",
" -t write output in tiles",
" -8 write BigTIFF instead of default ClassicTIFF",
+" -B write big-endian instead of native byte order",
+" -L write little-endian instead of native byte order",
+" -M disable use of memory-mapped files",
+" -C disable strip chopping",
" -i ignore read errors",
" -b file[,#] bias (dark) monochrome image to be subtracted from all others",
" -,=% use % rather than , to separate image #'s (per Note below)",
diff --git a/man/tiff2ps.1 b/man/tiff2ps.1
index b4a304a..0d672b0 100644
--- a/man/tiff2ps.1
+++ b/man/tiff2ps.1
@@ -149,6 +149,7 @@ be split in several pages. Options
and
.B \-W
are mutually exclusive.
+.TP
.B \-i
Enable/disable pixel interpolation. This option requires a
single numeric value: zero to disable pixel interpolation and

9
tests/get-version.c Normal file
View File

@ -0,0 +1,9 @@
#include <stdio.h>
extern const char *TIFFGetVersion(void);
int main(void)
{
printf("%s\n", TIFFGetVersion());
return 0;
}

32
tests/sanity Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh
TEST="/AppStream/compat-libtiff3/Sanity/get-version"
PACKAGES=${PACKAGES:-"compat-libtiff3"}
REQUIRES=${REQUIRES:-"gcc"}
LIBRARY="libtiff.so.3"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm --all
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp get-version.c $TmpDir/." 0 "Copying test code"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "gcc -l:$LIBRARY get-version.c -o get-version" 0 "Compiling test code"
rlAssertExists "get-version"
rlRun "./get-version > out" 0 "Running test code"
rlAssertGrep "^LIBTIFF, Version 3\." "out"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- atomic
- classic
- container
tests:
- sanity
required_packages:
- compat-libtiff3
- gcc