
Thread
2014.04.24 04:56 "Re: [Tiff] Custom EXIF write does not work for stream writer", by Edward Lam
On Tue, April 22, 2014 22:13, Chia-Kai Liang wrote:
I tried to use the EXIF directory read/write as described in http://www.asmail.be/msg0055060707.html, and find it would fail for stringstream
If I replace
tif = TIFFOpen(filename, "w+");
in the example code to
std::stringstream buf_stream;
tif = TIFFStreamOpen("MemTIFF", (std::ostream*)&buf_stream);
I would get the following error at TIFFSetDirectory(tif, 0):
TIFFFetchDirectory: MemTIFF: Can not read TIFF directory count. TIFFReadDirectory: Failed to read directory at offset 22688648.
Does using ostringstream instead of stringstream make a difference?
-Edward