Fixed saving TIFF images to wxMemoryOutputStream.

Libtiff attempts to seek past the end of a stream and the behaviour for this can vary per stream implementation. Fixed failure to seek by filling the gap between the end of stream and new seek position with zeroes. Enabled a unit test which so far was disabled due to wxMemoryOutputStream failing to save a TIFF because of the seeking problem.

Also closes #4089.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2011-08-18 13:15:43 +00:00
parent d06c3098ab
commit 7ffc9affb4
2 changed files with 37 additions and 10 deletions

View File

@@ -912,15 +912,8 @@ void CompareImage(const wxImageHandler& handler, const wxImage& image,
return;
}
if (type == wxBITMAP_TYPE_JPEG /* skip lossy JPEG */
|| type == wxBITMAP_TYPE_TIF)
if (type == wxBITMAP_TYPE_JPEG /* skip lossy JPEG */)
{
/*
TIFF is skipped because the memory stream can't be loaded. Libtiff
looks for a TIFF directory at offset 120008 while the memory
stream size is only 120008 bytes (when saving as a file
the file size is 120280 bytes).
*/
return;
}