---- tiff-3.9.1/libtiff/tif_dir.c.orig 2009-01-01 01:10:43.000000000 +0100
-+++ tiff-3.9.1/libtiff/tif_dir.c 2009-08-31 17:46:34.892612613 +0200
-@@ -138,6 +138,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va
+--- tiff-4.0.0/libtiff/tif_dir.c.orig 2011-02-19 17:26:09.000000000 +0100
++++ tiff-4.0.0/libtiff/tif_dir.c 2011-12-24 10:43:18.779372638 +0100
+@@ -153,6 +153,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va
{
static const char module[] = "_TIFFVSetField";
-+ const TIFFFieldInfo* fip;
++ const TIFFField* fip;
TIFFDirectory* td = &tif->tif_dir;
int status = 1;
uint32 v32, i, v;
-@@ -585,17 +586,19 @@ end:
+@@ -660,17 +661,19 @@ end:
va_end(ap);
return (status);
badvalue:
-+ fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
++ fip = TIFFFieldWithTag(tif, tag);
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Bad value %d for \"%s\" tag",
+ "%s: Bad value %u for \"%s\" tag",
tif->tif_name, v,
-- _TIFFFieldWithTag(tif, tag)->field_name);
+- TIFFFieldWithTag(tif, tag)->field_name);
+ fip ? fip->field_name : "Unknown");
va_end(ap);
return (0);
badvalue32:
-+ fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
++ fip = TIFFFieldWithTag(tif, tag);
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Bad value %u for \"%s\" tag",
tif->tif_name, v32,
-- _TIFFFieldWithTag(tif, tag)->field_name);
+- TIFFFieldWithTag(tif, tag)->field_name);
+ fip ? fip->field_name : "Unknown");
va_end(ap);
return (0);
}
---- tiff-3.9.1/libtiff/tif_dirread.c.orig 2009-01-01 01:10:43.000000000 +0100
-+++ tiff-3.9.1/libtiff/tif_dirread.c 2009-08-31 18:38:28.060606747 +0200
-@@ -190,6 +190,11 @@ TIFFReadDirectory(TIFF* tif)
- dp->tdir_tag,
- dp->tdir_tag);
-
-+ if (!compressionknown) {
-+ TIFFWarningExt(tif->tif_clientdata, module,
-+ "Ignoring, compression unknown");
-+ goto ignore;
-+ }
- if (!_TIFFMergeFieldInfo(tif,
- _TIFFCreateAnonFieldInfo(tif,
- dp->tdir_tag,
-@@ -583,6 +588,7 @@ TIFFReadDirectory(TIFF* tif)
+--- tiff-4.0.0/libtiff/tif_dirread.c.orig 2011-12-22 00:18:41.000000000 +0100
++++ tiff-4.0.0/libtiff/tif_dirread.c 2011-12-24 10:39:34.932698478 +0100
+@@ -3897,6 +3897,7 @@ TIFFReadDirectory(TIFF* tif)
* Attempt to deal with a missing StripByteCounts tag.
*/
if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
++ const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
/*
* Some manufacturers violate the spec by not giving
* the size of the strips. In this case, assume there
-@@ -599,7 +605,7 @@ TIFFReadDirectory(TIFF* tif)
- "%s: TIFF directory is missing required "
+@@ -3912,7 +3913,7 @@ TIFFReadDirectory(TIFF* tif)
+ TIFFWarningExt(tif->tif_clientdata, module,
+ "TIFF directory is missing required "
"\"%s\" field, calculating from imagelength",
- tif->tif_name,
-- _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
+- TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
+ fip ? fip->field_name : "Unknown");
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
/*
-@@ -626,6 +632,7 @@ TIFFReadDirectory(TIFF* tif)
- } else if (td->td_nstrips == 1
- && td->td_stripoffset[0] != 0
+@@ -3940,6 +3941,7 @@ TIFFReadDirectory(TIFF* tif)
+ && _TIFFFillStriles(tif)
+ && tif->tif_dir.td_stripoffset[0] != 0
&& BYTECOUNTLOOKSBAD) {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
++ const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
/*
* XXX: Plexus (and others) sometimes give a value of
* zero for a tag when they don't know what the
-@@ -635,7 +642,7 @@ TIFFReadDirectory(TIFF* tif)
+@@ -3948,7 +3950,7 @@ TIFFReadDirectory(TIFF* tif)
+ */
TIFFWarningExt(tif->tif_clientdata, module,
- "%s: Bogus \"%s\" field, ignoring and calculating from imagelength",
- tif->tif_name,
-- _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
-+ fip ? fip->field_name : "Unknown");
+ "Bogus \"%s\" field, ignoring and calculating from imagelength",
+- TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
++ fip ? fip->field_name : "Unknown");
if(EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
- } else if (td->td_planarconfig == PLANARCONFIG_CONTIG
-@@ -644,6 +651,7 @@ TIFFReadDirectory(TIFF* tif)
- && td->td_stripbytecount[0] != td->td_stripbytecount[1]
- && td->td_stripbytecount[0] != 0
- && td->td_stripbytecount[1] != 0 ) {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
+
+@@ -3959,6 +3961,7 @@ TIFFReadDirectory(TIFF* tif)
+ && tif->tif_dir.td_stripbytecount[0] != tif->tif_dir.td_stripbytecount[1]
+ && tif->tif_dir.td_stripbytecount[0] != 0
+ && tif->tif_dir.td_stripbytecount[1] != 0 ) {
++ const TIFFField* fip = TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
/*
- * XXX: Some vendors fill StripByteCount array with
- * absolutely wrong values (it can be equal to
-@@ -653,7 +661,7 @@ TIFFReadDirectory(TIFF* tif)
+ * XXX: Some vendors fill StripByteCount array with
+ * absolutely wrong values (it can be equal to
+@@ -3971,7 +3974,7 @@ TIFFReadDirectory(TIFF* tif)
+ */
TIFFWarningExt(tif->tif_clientdata, module,
- "%s: Wrong \"%s\" field, ignoring and calculating from imagelength",
- tif->tif_name,
-- _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
-+ fip ? fip->field_name : "Unknown");
+ "Wrong \"%s\" field, ignoring and calculating from imagelength",
+- TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
++ fip ? fip->field_name : "Unknown");
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
- }
-@@ -1024,16 +1032,18 @@ TIFFCheckDirOffset(TIFF* tif, toff_t dir
- static int
- CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
- {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
-+
- if (count > dir->tdir_count) {
- TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "incorrect count for field \"%s\" (%u, expecting %u); tag ignored",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
-+ fip ? fip->field_name : "Unknown",
- dir->tdir_count, count);
- return (0);
- } else if (count < dir->tdir_count) {
- TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "incorrect count for field \"%s\" (%u, expecting %u); tag trimmed",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
-+ fip ? fip->field_name : "Unknown",
- dir->tdir_count, count);
- return (1);
- }
-@@ -1153,6 +1163,7 @@ static tsize_t
- TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp)
- {
- uint32 w = TIFFDataWidth((TIFFDataType) dir->tdir_type);
-+ const TIFFFieldInfo* fip;
- /*
- * FIXME: butecount should have tsize_t type, but for now libtiff
- * defines tsize_t as a signed 32-bit integer and we are losing
-@@ -1200,9 +1211,10 @@ TIFFFetchData(TIFF* tif, TIFFDirEntry* d
- }
- return (cc);
- bad:
-+ fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Error fetching data for field \"%s\"",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
-+ fip ? fip->field_name : "Unknown");
- return (tsize_t) 0;
- }
-
-@@ -1229,9 +1241,10 @@ static int
- cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
- {
- if (denom == 0) {
-+ const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "%s: Rational with zero denominator (num = %u)",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num);
-+ fip ? fip->field_name : "Unknown", num);
- return (0);
- } else {
- if (dir->tdir_type == TIFF_RATIONAL)
-@@ -1351,9 +1364,10 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEnt
- * check on tdir_count, this should never be greater than two.
- */
- if (dir->tdir_count > 2) {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "unexpected count for field \"%s\", %u, expected 2; ignored",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
-+ fip ? fip->field_name : "Unknown",
- dir->tdir_count);
- return 0;
- }
-@@ -1529,11 +1543,14 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntr
- /* TIFF_NOTYPE */
- /* TIFF_ASCII */
- /* TIFF_UNDEFINED */
-+ {
-+ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "cannot read TIFF_ANY type %d for field \"%s\"",
- dir->tdir_type,
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
-+ fip ? fip->field_name : "Unknown");
- return (0);
-+ }
- }
- return (1);
- }
-@@ -1548,6 +1565,8 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEnt
- int ok = 0;
- const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag);
-
-+ if (fip == NULL)
-+ return (0);
- if (dp->tdir_count > 1) { /* array of values */
- char* cp = NULL;
-
-@@ -1707,9 +1726,10 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFF
-
- for (i = 1; i < check_count; i++)
- if (v[i] != v[0]) {
-+ const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Cannot handle different per-sample values for field \"%s\"",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
-+ fip ? fip->field_name : "Unknown");
- goto bad;
- }
- *pl = v[0];
-@@ -1748,9 +1768,10 @@ TIFFFetchPerSampleLongs(TIFF* tif, TIFFD
- check_count = samples;
- for (i = 1; i < check_count; i++)
- if (v[i] != v[0]) {
-+ const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Cannot handle different per-sample values for field \"%s\"",
-- _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
-+ fip ? fip->field_name : "Unknown");
- goto bad;
- }
- *pl = v[0];
+ #endif /* !defined(DEFER_STRILE_LOAD) */
+# TODO: libjpeg12 support (separate libjpeg compiled with 12-bits/sample)
#
# Conditional build:
%bcond_without opengl # do not build OpenGL viewer
Summary(pl.UTF-8): Biblioteka do manipulacji plikami w formacie TIFF
Summary(tr.UTF-8): TIFF dosyalarını işleme kitaplığı
Name: libtiff
-Version: 3.9.5
-Release: 2
+Version: 4.0.0
+Release: 1
License: BSD-like
Group: Libraries
Source0: http://download.osgeo.org/libtiff/tiff-%{version}.tar.gz
-# Source0-md5: 8fc7ce3b4e1d0cc8a319336967815084
+# Source0-md5: 456ad12e7c492b275a0d047f2ba89904
Patch0: %{name}-glut.patch
-Patch1: %{name}-CVE-2009-2285.patch
-Patch2: %{name}-sec.patch
+Patch1: %{name}-sec.patch
URL: http://www.remotesensing.org/libtiff/
%{?with_opengl:BuildRequires: OpenGL-glut-devel}
BuildRequires: autoconf >= 2.64
BuildRequires: libjpeg-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool >= 2:2.2
+%{?with_opengl:BuildRequires: xorg-lib-libX11-devel}
+BuildRequires: xz-devel
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Requires: %{name} = %{version}-%{release}
Requires: jbigkit-devel
Requires: libjpeg-devel
+Requires: xz-devel
Requires: zlib-devel
%description devel
%prep
%setup -q -n tiff-%{version}
-%patch0 -p0
+%patch0 -p1
%patch1 -p1
-%patch2 -p1
-
-%{__rm} m4/{libtool,lt*}.m4
%build
%{__libtoolize}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_bindir},%{_mandir}/man1}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
%{__rm} -r html{,/*}/Makefile* $RPM_BUILD_ROOT%{_docdir}/tiff-%{version}
+# program not packaged
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/sgi2tiff.1
+
+# libtiff.la kept - Libs.private are incomplete (lzma missing)
+
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc COPYRIGHT ChangeLog README TODO
%attr(755,root,root) %{_libdir}/libtiff.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libtiff.so.3
+%attr(755,root,root) %ghost %{_libdir}/libtiff.so.5
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libtiff.so
%{_libdir}/libtiff.la
%{_includedir}/tiff*.h
+%{_pkgconfigdir}/libtiff-4.pc
%{_mandir}/man3/TIFF*.3tiff*
%{_mandir}/man3/libtiff.3tiff*
%files cxx
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libtiffxx.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libtiffxx.so.3
+%attr(755,root,root) %ghost %{_libdir}/libtiffxx.so.5
%files cxx-devel
%defattr(644,root,root,755)
%files progs
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
-%if %{with opengl}
-%exclude %{_mandir}/man1/tiffgt.1*
-%exclude %{_bindir}/tiffgt
-%endif
+%attr(755,root,root) %{_bindir}/bmp2tiff
+%attr(755,root,root) %{_bindir}/fax2ps
+%attr(755,root,root) %{_bindir}/fax2tiff
+%attr(755,root,root) %{_bindir}/gif2tiff
+%attr(755,root,root) %{_bindir}/pal2rgb
+%attr(755,root,root) %{_bindir}/ppm2tiff
+%attr(755,root,root) %{_bindir}/ras2tiff
+%attr(755,root,root) %{_bindir}/raw2tiff
+%attr(755,root,root) %{_bindir}/rgb2ycbcr
+%attr(755,root,root) %{_bindir}/thumbnail
+%attr(755,root,root) %{_bindir}/tiff[!g]*
+%{_mandir}/man1/bmp2tiff.1*
+%{_mandir}/man1/fax2ps.1*
+%{_mandir}/man1/fax2tiff.1*
+%{_mandir}/man1/gif2tiff.1*
+%{_mandir}/man1/pal2rgb.1*
+%{_mandir}/man1/ppm2tiff.1*
+%{_mandir}/man1/ras2tiff.1*
+%{_mandir}/man1/raw2tiff.1*
+%{_mandir}/man1/rgb2ycbcr.1*
+%{_mandir}/man1/thumbnail.1*
+%{_mandir}/man1/tiff[!g]*.1*
%if %{with opengl}
%files progs-gl