fix problem with tiff seek

This commit is contained in:
David Rose 2003-08-01 17:58:11 +00:00
parent d2c4c025a8
commit 580250bd6f
1 changed files with 14 additions and 2 deletions

View File

@ -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();
}