From 580250bd6f28830557a43c1bb2b982d2fc29d387 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 1 Aug 2003 17:58:11 +0000 Subject: [PATCH] fix problem with tiff seek --- panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx index d5853f55a4..ecef37bb0b 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx @@ -118,7 +118,7 @@ istream_dont_write(thandle_t, tdata_t, tsize_t) { } static toff_t -istream_seek(thandle_t fd, off_t off, int whence) { +istream_seek(thandle_t fd, toff_t off, int whence) { istream *in = (istream *)fd; ios_seekdir dir; @@ -140,11 +140,17 @@ istream_seek(thandle_t fd, off_t off, int whence) { } in->seekg(off, dir); + + if (pnmimage_tiff_cat->is_spam()) { + pnmimage_tiff_cat->spam() + << "istream_seek(" << (void *)in << ", " << off << ", " + << whence << "), result = " << in->tellg() << "\n"; + } return in->tellg(); } static toff_t -ostream_seek(thandle_t fd, off_t off, int whence) { +ostream_seek(thandle_t fd, toff_t off, int whence) { ostream *out = (ostream *)fd; ios_seekdir dir; @@ -166,6 +172,12 @@ ostream_seek(thandle_t fd, off_t off, int whence) { } out->seekp(off, dir); + + if (pnmimage_tiff_cat->is_spam()) { + pnmimage_tiff_cat->spam() + << "ostream_seek(" << (void *)out << ", " << off << ", " + << whence << "), result = " << out->tellp() << "\n"; + } return out->tellp(); }