AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.01.25 18:29 "issues with TIFFStreamOpen", by Michael Rinne
2005.01.27 19:45 "Re: issues with TIFFStreamOpen", by Edward Lam
2005.01.27 21:51 "Re: issues with TIFFStreamOpen", by Edward Lam
2005.01.28 10:28 "Re: issues with TIFFStreamOpen", by Michael Rinne
2005.01.28 16:24 "Re: issues with TIFFStreamOpen", by Edward Lam
2005.01.28 16:45 "Re: issues with TIFFStreamOpen", by Michael Rinne
2005.01.30 12:02 "Re: issues with TIFFStreamOpen", by Andrey Kiselev
2005.01.30 23:19 "Re: issues with TIFFStreamOpen", by Edward Lam
2005.01.31 21:20 "Re: issues with TIFFStreamOpen", by Michael Rinne
2005.01.28 19:58 "Re: issues with TIFFStreamOpen", by Frank Warmerdam

2005.01.28 16:45 "Re: issues with TIFFStreamOpen", by Michael Rinne

Hi Edward,

Edward Lam wrote:
> 
> I've logged this issue as a minor bug under #756.

thanks, I have not been aware of bugzilla for libTIFF before.

> > > How does anyone expect to treat streams generically? <sigh> We could do 
> >
> > I totally agree with that. ;-(
> 
> Not to mention the fact that in gcc 2.96, we had to do ugly hacks so 
> that we could seek using ostrstream's. :( We've debated here before 
> whether we should just give up on iostreams completely because we've 
> been bitten by poor implementations so many times. We've seen cases 
> where streaming a buffer would cause a memory reallocation every 
> *single* character!

Sounds like you are talking about the ostringstream implementation in MS 
VC 6.0 SP*. We have a workaround in our software, which assigns a string 
of the expected size to the ostringstream before writing a large amount 
of characters. M$ fixed the implementation of ostringstream in MS VC 
7.1. However, such a workaround is nothing one can do in a library which 
gets called with an object casted to the base class ostream.

> > With this fix I get a valid TIFF image with the correct size and color 
> > depth, but unfortunately it is all black.
> > ...
> >
> > I patched this to
> >
> > 140:    // extend the stream to the expected size
> > 141:    os->seekp(0, ios::end);
> > 142:    num_fill = origin + off - (toff_t)os->tellp();
> >
> > which resulted in a valid TIFF file with my test image.
> 
> Excellent! Sorry about the obvious bug. It explains why you get a black 
> image doesn't it? :) I don't see anything else wrong with the file now, 
> shall we submit your latest version of tif_stream.cxx to bugzilla?

That would be great! Can you do it? You seem to be more familiar with 
the libTIFF development and you made most of the changes in that file.

Thanks,
Michael