summaryrefslogtreecommitdiff
path: root/libtiff
diff options
context:
space:
mode:
authorJoris Van Damme <joris.at.lebbeke@skynet.be>2007-03-31 01:41:10 +0000
committerJoris Van Damme <joris.at.lebbeke@skynet.be>2007-03-31 01:41:10 +0000
commit7c0eb6eb47661fc3ff38d52dacafa13eb6a39923 (patch)
treea76c94637b981ce38bd71f4c35580c225cb8d4dc /libtiff
parentba321978d8bb83c2c8f4b08f3d972748590fa64c (diff)
downloadlibtiff-git-7c0eb6eb47661fc3ff38d52dacafa13eb6a39923.tar.gz
BigTIFF upgrade in progress - widespread temp mess - does not compile now
Diffstat (limited to 'libtiff')
-rw-r--r--libtiff/tif_color.c2
-rw-r--r--libtiff/tif_compress.c2
-rw-r--r--libtiff/tif_dir.c2
-rw-r--r--libtiff/tif_dir.h2
-rw-r--r--libtiff/tif_dirinfo.c2
-rw-r--r--libtiff/tif_dirread.c2
-rw-r--r--libtiff/tif_dirwrite.c2
-rw-r--r--libtiff/tif_dumpmode.c2
-rw-r--r--libtiff/tif_fax3.c6
-rw-r--r--libtiff/tif_getimage.c2
-rw-r--r--libtiff/tif_jbig.c2
-rw-r--r--libtiff/tif_jpeg.c2
-rw-r--r--libtiff/tif_luv.c2
-rw-r--r--libtiff/tif_lzw.c2
-rw-r--r--libtiff/tif_next.c2
-rw-r--r--libtiff/tif_ojpeg.c2
-rw-r--r--libtiff/tif_open.c2
-rw-r--r--libtiff/tif_packbits.c2
-rw-r--r--libtiff/tif_pixarlog.c2
-rw-r--r--libtiff/tif_predict.c2
-rw-r--r--libtiff/tif_print.c2
-rw-r--r--libtiff/tif_read.c2
-rw-r--r--libtiff/tif_strip.c2
-rw-r--r--libtiff/tif_swab.c2
-rw-r--r--libtiff/tif_thunder.c2
-rw-r--r--libtiff/tif_tile.c2
-rw-r--r--libtiff/tif_vms.c2
-rw-r--r--libtiff/tif_win32.c2
-rw-r--r--libtiff/tif_write.c220
-rw-r--r--libtiff/tif_zip.c2
-rw-r--r--libtiff/tiffio.h8
-rw-r--r--libtiff/tiffiop.h4
32 files changed, 142 insertions, 152 deletions
diff --git a/libtiff/tif_color.c b/libtiff/tif_color.c
index 026a534e..2eca44dd 100644
--- a/libtiff/tif_color.c
+++ b/libtiff/tif_color.c
@@ -1,4 +1,4 @@
-/* $Id: tif_color.c,v 1.14 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_color.c,v 1.15 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_compress.c b/libtiff/tif_compress.c
index f1015190..b254c882 100644
--- a/libtiff/tif_compress.c
+++ b/libtiff/tif_compress.c
@@ -1,4 +1,4 @@
-/* $Id: tif_compress.c,v 1.14 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_compress.c,v 1.15 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
index f2d0c7f9..04b0966c 100644
--- a/libtiff/tif_dir.c
+++ b/libtiff/tif_dir.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dir.c,v 1.78 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_dir.c,v 1.79 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
index 8635e825..6bcbb8bc 100644
--- a/libtiff/tif_dir.h
+++ b/libtiff/tif_dir.h
@@ -1,4 +1,4 @@
-/* $Id: tif_dir.h,v 1.33 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_dir.h,v 1.34 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
index 153a7b7a..5d02e8fe 100644
--- a/libtiff/tif_dirinfo.c
+++ b/libtiff/tif_dirinfo.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirinfo.c,v 1.68 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_dirinfo.c,v 1.69 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 84985458..325e1562 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirread.c,v 1.102 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_dirread.c,v 1.103 2007-03-31 01:41:10 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
index c4cb8dcf..5d1defa2 100644
--- a/libtiff/tif_dirwrite.c
+++ b/libtiff/tif_dirwrite.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirwrite.c,v 1.40 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_dirwrite.c,v 1.41 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_dumpmode.c b/libtiff/tif_dumpmode.c
index 3fc413f6..05167481 100644
--- a/libtiff/tif_dumpmode.c
+++ b/libtiff/tif_dumpmode.c
@@ -1,4 +1,4 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.6 2007-03-31 01:04:52 joris Exp $ */
+/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.7 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_fax3.c b/libtiff/tif_fax3.c
index 1ca47566..e902ffa1 100644
--- a/libtiff/tif_fax3.c
+++ b/libtiff/tif_fax3.c
@@ -1,4 +1,4 @@
-/* $Id: tif_fax3.c,v 1.46 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_fax3.c,v 1.47 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@@ -780,7 +780,7 @@ static int32 find1span(unsigned char*, int32, int32);
* table. The ``base'' of the bit string is supplied
* along with the start+end bit indices.
*/
-static inline int32
+inline static int32
find0span(unsigned char* bp, int32 bs, int32 be)
{
int32 bits = be - bs;
@@ -839,7 +839,7 @@ find0span(unsigned char* bp, int32 bs, int32 be)
return (span);
}
-static inline int32
+inline static int32
find1span(unsigned char* bp, int32 bs, int32 be)
{
int32 bits = be - bs;
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
index c6d6e09d..f074fa16 100644
--- a/libtiff/tif_getimage.c
+++ b/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Id: tif_getimage.c,v 1.65 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_getimage.c,v 1.66 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_jbig.c b/libtiff/tif_jbig.c
index 3994dc0a..03d9177d 100644
--- a/libtiff/tif_jbig.c
+++ b/libtiff/tif_jbig.c
@@ -1,4 +1,4 @@
-/* $Id: tif_jbig.c,v 1.3 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_jbig.c,v 1.4 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index 1cf3f21e..cd20ef37 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -1,4 +1,4 @@
-/* $Id: tif_jpeg.c,v 1.52 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_jpeg.c,v 1.53 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1994-1997 Sam Leffler
diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
index abd0d828..ee71e7b4 100644
--- a/libtiff/tif_luv.c
+++ b/libtiff/tif_luv.c
@@ -1,4 +1,4 @@
-/* $Id: tif_luv.c,v 1.19 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_luv.c,v 1.20 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1997 Greg Ward Larson
diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
index 050857db..5ed40ca4 100644
--- a/libtiff/tif_lzw.c
+++ b/libtiff/tif_lzw.c
@@ -1,4 +1,4 @@
-/* $Id: tif_lzw.c,v 1.30 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_lzw.c,v 1.31 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_next.c b/libtiff/tif_next.c
index d27a8e13..f2e98e88 100644
--- a/libtiff/tif_next.c
+++ b/libtiff/tif_next.c
@@ -1,4 +1,4 @@
-/* $Id: tif_next.c,v 1.9 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_next.c,v 1.10 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
index 5cf93a1f..df40c708 100644
--- a/libtiff/tif_ojpeg.c
+++ b/libtiff/tif_ojpeg.c
@@ -1,4 +1,4 @@
-/* $Id: tif_ojpeg.c,v 1.25 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_ojpeg.c,v 1.26 2007-03-31 01:41:11 joris Exp $ */
/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
specification is now totally obsolete and deprecated for new applications and
diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index a967e0b2..b06c5aed 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -1,4 +1,4 @@
-/* $Id: tif_open.c,v 1.35 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_open.c,v 1.36 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_packbits.c b/libtiff/tif_packbits.c
index 43ea2e1a..04b7e4f2 100644
--- a/libtiff/tif_packbits.c
+++ b/libtiff/tif_packbits.c
@@ -1,4 +1,4 @@
-/* $Id: tif_packbits.c,v 1.15 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_packbits.c,v 1.16 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
index 4a3210e8..e682be87 100644
--- a/libtiff/tif_pixarlog.c
+++ b/libtiff/tif_pixarlog.c
@@ -1,4 +1,4 @@
-/* $Id: tif_pixarlog.c,v 1.17 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_pixarlog.c,v 1.18 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1996-1997 Sam Leffler
diff --git a/libtiff/tif_predict.c b/libtiff/tif_predict.c
index 898da053..b12c32c6 100644
--- a/libtiff/tif_predict.c
+++ b/libtiff/tif_predict.c
@@ -1,4 +1,4 @@
-/* $Id: tif_predict.c,v 1.13 2007-03-31 01:04:52 joris Exp $ */
+/* $Id: tif_predict.c,v 1.14 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index acafc3c2..0b972862 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -1,4 +1,4 @@
-/* $Id: tif_print.c,v 1.37 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_print.c,v 1.38 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
index 2d48c757..7a840629 100644
--- a/libtiff/tif_read.c
+++ b/libtiff/tif_read.c
@@ -1,4 +1,4 @@
-/* $Id: tif_read.c,v 1.18 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_read.c,v 1.19 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
index 8520f1f0..a4e64ff6 100644
--- a/libtiff/tif_strip.c
+++ b/libtiff/tif_strip.c
@@ -1,4 +1,4 @@
-/* $Id: tif_strip.c,v 1.21 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_strip.c,v 1.22 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_swab.c b/libtiff/tif_swab.c
index 022ffbf5..f9a40e66 100644
--- a/libtiff/tif_swab.c
+++ b/libtiff/tif_swab.c
@@ -1,4 +1,4 @@
-/* $Id: tif_swab.c,v 1.7 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_swab.c,v 1.8 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_thunder.c b/libtiff/tif_thunder.c
index 3e7dd911..8ec0bce0 100644
--- a/libtiff/tif_thunder.c
+++ b/libtiff/tif_thunder.c
@@ -1,4 +1,4 @@
-/* $Id: tif_thunder.c,v 1.6 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_thunder.c,v 1.7 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_tile.c b/libtiff/tif_tile.c
index 3c9add8e..762b6719 100644
--- a/libtiff/tif_tile.c
+++ b/libtiff/tif_tile.c
@@ -1,4 +1,4 @@
-/* $Id: tif_tile.c,v 1.14 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_tile.c,v 1.15 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
diff --git a/libtiff/tif_vms.c b/libtiff/tif_vms.c
index 872625ff..e6d26e7f 100644
--- a/libtiff/tif_vms.c
+++ b/libtiff/tif_vms.c
@@ -1,4 +1,4 @@
-/* $Id: tif_vms.c,v 1.6 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_vms.c,v 1.7 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c
index 3479e5ad..8780d306 100644
--- a/libtiff/tif_win32.c
+++ b/libtiff/tif_win32.c
@@ -1,4 +1,4 @@
-/* $Id: tif_win32.c,v 1.23 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_win32.c,v 1.24 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
diff --git a/libtiff/tif_write.c b/libtiff/tif_write.c
index edb363c2..dec38a89 100644
--- a/libtiff/tif_write.c
+++ b/libtiff/tif_write.c
@@ -1,4 +1,4 @@
-/* $Id: tif_write.c,v 1.24 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_write.c,v 1.25 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -333,20 +333,20 @@ TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
* interface does not support automatically growing
* the image on each write (as TIFFWriteScanline does).
*/
-tsize_t
-TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
+uint64
+TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, uint64 cc)
{
static const char module[] = "TIFFWriteEncodedTile";
TIFFDirectory *td;
uint16 sample;
if (!WRITECHECKTILES(tif, module))
- return ((tsize_t) -1);
+ return ((uint64) -1);
td = &tif->tif_dir;
- if (tile >= td->td_nstrips) { ddd
- TIFFErrorExt(tif->tif_clientdata, module, "%s: Tile %lu out of range, max %lu",
- tif->tif_name, (unsigned long) tile, (unsigned long) td->td_nstrips); ddd
- return ((tsize_t) -1);
+ if (tile >= td->td_nstrips) {
+ TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu",
+ (unsigned long) tile, (unsigned long) td->td_nstrips);
+ return ((uint64) -1);
}
/*
* Handle delayed allocation of data buffer. This
@@ -354,7 +354,7 @@ TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
* directory information).
*/
if (!BUFFERCHECK(tif))
- return ((tsize_t) -1);
+ return ((uint64) -1);
tif->tif_curtile = tile;
tif->tif_rawcc = 0;
@@ -373,41 +373,41 @@ TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
* Compute tiles per row & per column to compute
* current row and column
*/
- tif->tif_row = (tile % TIFFhowmany(td->td_imagelength, td->td_tilelength)) ddd
+ tif->tif_row = (tile % TIFFhowmany_32(td->td_imagelength, td->td_tilelength))
* td->td_tilelength;
- tif->tif_col = (tile % TIFFhowmany(td->td_imagewidth, td->td_tilewidth)) ddd
+ tif->tif_col = (tile % TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth))
* td->td_tilewidth;
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupencode)(tif))
- return ((tsize_t) -1);
+ return ((uint64) -1);
tif->tif_flags |= TIFF_CODERSETUP;
}
tif->tif_flags &= ~TIFF_POSTENCODE;
sample = (uint16)(tile/td->td_stripsperimage);
if (!(*tif->tif_preencode)(tif, sample))
- return ((tsize_t) -1);
+ return ((uint64) -1);
/*
* Clamp write amount to the tile size. This is mostly
* done so that callers can pass in some large number
* (e.g. -1) and have the tile size used instead.
*/
- if ( cc < 1 || cc > tif->tif_tilesize) ddd
- cc = tif->tif_tilesize; ddd
+ if ( cc < 1 || cc > tif->tif_tilesize)
+ cc = tif->tif_tilesize;
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (tidata_t) data, cc ); ddd
+ tif->tif_postdecode( tif, (uint8*) data, cc );
- if (!(*tif->tif_encodetile)(tif, (tidata_t) data, cc, sample)) ddd
- return ((tsize_t) 0);
+ if (!(*tif->tif_encodetile)(tif, (uint8*) data, cc, sample))
+ return ((uint64) 0);
if (!(*tif->tif_postencode)(tif))
- return ((tsize_t) -1);
+ return ((uint64) -1);
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((unsigned char *)tif->tif_rawdata, tif->tif_rawcc); ddd
- if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile, ddd
- tif->tif_rawdata, tif->tif_rawcc)) ddd
- return ((tsize_t) -1);
+ TIFFReverseBits((uint8*)tif->tif_rawdata, tif->tif_rawcc);
+ if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile,
+ tif->tif_rawdata, tif->tif_rawcc))
+ return ((uint64) -1);
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
return (cc);
@@ -422,21 +422,21 @@ TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
* interface does not support automatically growing
* the image on each write (as TIFFWriteScanline does).
*/
-tsize_t
-TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
+uint64
+TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, uint64 cc)
{
static const char module[] = "TIFFWriteRawTile";
if (!WRITECHECKTILES(tif, module))
- return ((tsize_t) -1);
- if (tile >= tif->tif_dir.td_nstrips) { ddd
- TIFFErrorExt(tif->tif_clientdata, module, "%s: Tile %lu out of range, max %lu",
- tif->tif_name, (unsigned long) tile,
- (unsigned long) tif->tif_dir.td_nstrips); ddd
- return ((tsize_t) -1);
+ return ((uint64) -1);
+ if (tile >= tif->tif_dir.td_nstrips) {
+ TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu",
+ (unsigned long) tile,
+ (unsigned long) tif->tif_dir.td_nstrips);
+ return ((uint64) -1);
}
- return (TIFFAppendToStrip(tif, tile, (tidata_t) data, cc) ? ddd
- cc : (tsize_t) -1);
+ return (TIFFAppendToStrip(tif, tile, (uint8*) data, cc) ?
+ cc : (uint64) -1);
}
#define isUnspecified(tif, f) \
@@ -448,28 +448,28 @@ TIFFSetupStrips(TIFF* tif)
TIFFDirectory* td = &tif->tif_dir;
if (isTiled(tif))
- td->td_stripsperimage = ddd
+ td->td_stripsperimage =
isUnspecified(tif, FIELD_TILEDIMENSIONS) ?
- td->td_samplesperpixel : TIFFNumberOfTiles(tif); ddd
+ td->td_samplesperpixel : TIFFNumberOfTiles(tif);
else
- td->td_stripsperimage = ddd
+ td->td_stripsperimage =
isUnspecified(tif, FIELD_ROWSPERSTRIP) ?
- td->td_samplesperpixel : TIFFNumberOfStrips(tif); ddd
- td->td_nstrips = td->td_stripsperimage; ddd
+ td->td_samplesperpixel : TIFFNumberOfStrips(tif);
+ td->td_nstrips = td->td_stripsperimage;
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
- td->td_stripsperimage /= td->td_samplesperpixel; ddd
- td->td_stripoffset = (uint32 *) ddd
- _TIFFmalloc(td->td_nstrips * sizeof (uint32)); ddd
- td->td_stripbytecount = (uint32 *) ddd
- _TIFFmalloc(td->td_nstrips * sizeof (uint32)); ddd
- if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL) ddd
+ td->td_stripsperimage /= td->td_samplesperpixel;
+ td->td_stripoffset = (uint64 *)
+ _TIFFmalloc(td->td_nstrips * sizeof (uint64));
+ td->td_stripbytecount = (uint64 *)
+ _TIFFmalloc(td->td_nstrips * sizeof (uint64));
+ if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL)
return (0);
/*
* Place data at the end-of-file
* (by setting offsets to zero).
*/
- _TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint32)); ddd
- _TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint32)); ddd
+ _TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint64));
+ _TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint64));
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
return (1);
@@ -486,12 +486,11 @@ int
TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
{
if (tif->tif_mode == O_RDONLY) {
- TIFFErrorExt(tif->tif_clientdata, module, "%s: File not open for writing",
- tif->tif_name);
+ TIFFErrorExt(tif->tif_clientdata, module, "File not open for writing");
return (0);
}
if (tiles ^ isTiled(tif)) {
- TIFFErrorExt(tif->tif_clientdata, tif->tif_name, tiles ?
+ TIFFErrorExt(tif->tif_clientdata, module, tiles ?
"Can not write tiles to a stripped image" :
"Can not write scanlines to a tiled image");
return (0);
@@ -509,8 +508,7 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
*/
if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Must set \"ImageWidth\" before writing data",
- tif->tif_name);
+ "Must set \"ImageWidth\" before writing data");
return (0);
}
if (tif->tif_dir.td_samplesperpixel == 1) {
@@ -524,19 +522,18 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
} else {
if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Must set \"PlanarConfiguration\" before writing data",
- tif->tif_name);
+ "Must set \"PlanarConfiguration\" before writing data");
return (0);
}
}
- if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) { ddd
+ if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) {
tif->tif_dir.td_nstrips = 0;
- TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for %s arrays",
- tif->tif_name, isTiled(tif) ? "tile" : "strip");
+ TIFFErrorExt(tif->tif_clientdata, module, "No space for %s arrays",
+ isTiled(tif) ? "tile" : "strip");
return (0);
}
- tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1; ddd
- tif->tif_scanlinesize = TIFFScanlineSize(tif); ddd
+ tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (uint64) -1;
+ tif->tif_scanlinesize = TIFFScanlineSize(tif);
tif->tif_flags |= TIFF_BEENWRITING;
return (1);
}
@@ -549,7 +546,6 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, uint64 size)
{
static const char module[] = "TIFFWriteBufferSetup";
- ddd
if (tif->tif_rawdata) {
if (tif->tif_flags & TIFF_MYBUFFER) {
_TIFFfree(tif->tif_rawdata);
@@ -557,9 +553,9 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, uint64 size)
}
tif->tif_rawdata = NULL;
}
- if (size == (tsize_t) -1) {
+ if (size == (uint64) -1) {
size = (isTiled(tif) ?
- tif->tif_tilesize : TIFFStripSize(tif)); ddd
+ tif->tif_tilesize : TIFFStripSize(tif));
/*
* Make raw data buffer at least 8K
*/
@@ -570,15 +566,14 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, uint64 size)
if (bp == NULL) {
bp = _TIFFmalloc(size);
if (bp == NULL) {
- TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for output buffer",
- tif->tif_name);
+ TIFFErrorExt(tif->tif_clientdata, module, "No space for output buffer");
return (0);
}
tif->tif_flags |= TIFF_MYBUFFER;
} else
tif->tif_flags &= ~TIFF_MYBUFFER;
- tif->tif_rawdata = (tidata_t) bp;
- tif->tif_rawdatasize = size; ddd
+ tif->tif_rawdata = (uint8*) bp;
+ tif->tif_rawdatasize = size;
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
tif->tif_flags |= TIFF_BUFFERSETUP;
@@ -591,32 +586,31 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, uint64 size)
static int
TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
{
- ddd
- TIFFDirectory *td = &tif->tif_dir;
- uint32 *new_stripoffset, *new_stripbytecount;
+ TIFFDirectory *td = &tif->tif_dir;
+ uint32* new_stripoffset;
+ uint32* new_stripbytecount;
assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
- new_stripoffset = (uint32*)_TIFFrealloc(td->td_stripoffset, ddd
- (td->td_nstrips + delta) * sizeof (uint32)); ddd
- new_stripbytecount = (uint32*)_TIFFrealloc(td->td_stripbytecount, ddd
- (td->td_nstrips + delta) * sizeof (uint32)); ddd
+ new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset,
+ (td->td_nstrips + delta) * sizeof (uint64));
+ new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount,
+ (td->td_nstrips + delta) * sizeof (uint64));
if (new_stripoffset == NULL || new_stripbytecount == NULL) {
if (new_stripoffset)
_TIFFfree(new_stripoffset);
if (new_stripbytecount)
_TIFFfree(new_stripbytecount);
td->td_nstrips = 0;
- TIFFErrorExt(tif->tif_clientdata, module, "%s: No space to expand strip arrays",
- tif->tif_name);
+ TIFFErrorExt(tif->tif_clientdata, module, "No space to expand strip arrays");
return (0);
}
- td->td_stripoffset = new_stripoffset; ddd
- td->td_stripbytecount = new_stripbytecount; ddd
- _TIFFmemset(td->td_stripoffset + td->td_nstrips, ddd
- 0, delta*sizeof (uint32));
- _TIFFmemset(td->td_stripbytecount + td->td_nstrips, ddd
- 0, delta*sizeof (uint32));
- td->td_nstrips += delta; ddd
+ td->td_stripoffset = new_stripoffset;
+ td->td_stripbytecount = new_stripbytecount;
+ _TIFFmemset(td->td_stripoffset + td->td_nstrips,
+ 0, delta*sizeof (uint64));
+ _TIFFmemset(td->td_stripbytecount + td->td_nstrips,
+ 0, delta*sizeof (uint64));
+ td->td_nstrips += delta;
return (1);
}
@@ -626,16 +620,15 @@ TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
static int
TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, uint64 cc)
{
- ddd
TIFFDirectory *td = &tif->tif_dir;
static const char module[] = "TIFFAppendToStrip";
- if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) { ddd
- /*
+ if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) {
+ /*
* No current offset, set the current strip.
*/
assert(td->td_nstrips > 0);
- if (td->td_stripoffset[strip] != 0) { ddd
+ if (td->td_stripoffset[strip] != 0) {
/*
* Prevent overlapping of the data chunks. We need
* this to enable in place updating of the compressed
@@ -644,49 +637,46 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, uint64 cc)
* space, so such scheme is not too much effective.
*/
if (td->td_stripbytecountsorted) {
- if (strip == td->td_nstrips - 1 ddd
- || td->td_stripoffset[strip + 1] < ddd
- td->td_stripoffset[strip] + cc) { ddd
- td->td_stripoffset[strip] = ddd
- TIFFSeekFile(tif, (toff_t)0,
+ if (strip == td->td_nstrips - 1
+ || td->td_stripoffset[strip + 1] <
+ td->td_stripoffset[strip] + cc) {
+ td->td_stripoffset[strip] =
+ TIFFSeekFile(tif,0,
SEEK_END);
td->td_stripbytecountsorted = 0;
}
} else {
- tstrip_t i;
- for (i = 0; i < td->td_nstrips; i++) { ddd
- if (td->td_stripoffset[i] > ddd
- td->td_stripoffset[strip] ddd
- && td->td_stripoffset[i] < ddd
- td->td_stripoffset[strip] + cc) { ddd
- td->td_stripoffset[strip] = ddd
- TIFFSeekFile(tif,
- (toff_t)0,
- SEEK_END);
+ uint32 i;
+ for (i = 0; i < td->td_nstrips; i++) {
+ if (td->td_stripoffset[i] >
+ td->td_stripoffset[strip]
+ && td->td_stripoffset[i] <
+ td->td_stripoffset[strip] + cc) {
+ td->td_stripoffset[strip] =
+ TIFFSeekFile(tif, 0, SEEK_END);
}
}
}
- if (!SeekOK(tif, td->td_stripoffset[strip])) { ddd
- TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Seek error at scanline %lu",
- tif->tif_name,
- (unsigned long)tif->tif_row);
+ if (!SeekOK(tif, td->td_stripoffset[strip])) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Seek error at scanline %lu",
+ (unsigned long)tif->tif_row);
return (0);
}
} else
- td->td_stripoffset[strip] = ddd
- TIFFSeekFile(tif, (toff_t) 0, SEEK_END);
- tif->tif_curoff = td->td_stripoffset[strip]; ddd
+ td->td_stripoffset[strip] =
+ TIFFSeekFile(tif, 0, SEEK_END);
+ tif->tif_curoff = td->td_stripoffset[strip];
}
if (!WriteOK(tif, data, cc)) {
- TIFFErrorExt(tif->tif_clientdata, module, "%s: Write error at scanline %lu",
- tif->tif_name, (unsigned long) tif->tif_row);
+ TIFFErrorExt(tif->tif_clientdata, module, "Write error at scanline %lu",
+ (unsigned long) tif->tif_row);
return (0);
}
tif->tif_curoff += cc;
- td->td_stripbytecount[strip] += cc; ddd
+ td->td_stripbytecount[strip] += cc;
return (1);
}
@@ -701,9 +691,9 @@ TIFFFlushData1(TIFF* tif)
if (tif->tif_rawcc > 0) {
if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((unsigned char *)tif->tif_rawdata, ddd
- tif->tif_rawcc); ddd
- if (!TIFFAppendToStrip(tif, ddd
+ TIFFReverseBits((uint8*)tif->tif_rawdata,
+ tif->tif_rawcc);
+ if (!TIFFAppendToStrip(tif,
isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
tif->tif_rawdata, tif->tif_rawcc))
return (0);
@@ -720,7 +710,7 @@ TIFFFlushData1(TIFF* tif)
* appended to the end of the file.
*/
void
-TIFFSetWriteOffset(TIFF* tif, toff_t off)
+TIFFSetWriteOffset(TIFF* tif, uint64 off)
{
tif->tif_curoff = off;
}
diff --git a/libtiff/tif_zip.c b/libtiff/tif_zip.c
index 6daab1c6..355c6622 100644
--- a/libtiff/tif_zip.c
+++ b/libtiff/tif_zip.c
@@ -1,4 +1,4 @@
-/* $Id: tif_zip.c,v 1.12 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tif_zip.c,v 1.13 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 3729f65e..3e05a6cf 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -1,4 +1,4 @@
-/* $Id: tiffio.h,v 1.60 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tiffio.h,v 1.61 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -458,10 +458,10 @@ extern uint64 TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, uint64 size
extern uint64 TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, uint64 size);
extern uint64 TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, uint64 cc);
extern uint64 TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, uint64 cc);
-extern tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
-extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern uint64 TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, uint64 cc);
+extern uint64 TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, uint64 cc);
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
-extern void TIFFSetWriteOffset(TIFF*, toff_t);
+extern void TIFFSetWriteOffset(TIFF* tif, uint64 off);
extern void TIFFSwabShort(uint16*);
extern void TIFFSwabLong(uint32*);
extern void TIFFSwabLong8(uint64*);
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index 9cbfa087..646bbe4d 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Id: tiffiop.h,v 1.54 2007-03-31 01:04:53 joris Exp $ */
+/* $Id: tiffiop.h,v 1.55 2007-03-31 01:41:11 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -138,7 +138,7 @@ struct tiff {
uint32 tif_row; /* current scanline */
tdir_t tif_curdir; /* current directory (index) */
uint32 tif_curstrip; /* current strip for read/write */
- toff_t tif_curoff; /* current offset for read/write */
+ uint64 tif_curoff; /* current offset for read/write */
toff_t tif_dataoff; /* current offset for writing dir */
/* SubIFD support */
uint16 tif_nsubifd; /* remaining subifds to write */