Compile fix for GIF decoder,

Added image index to loadfile.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-11-30 17:24:14 +00:00
parent a05da1b682
commit 700ec4546c
10 changed files with 51 additions and 23 deletions

View File

@@ -119,7 +119,7 @@ TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode)
}
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose )
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
{
image->Destroy();
@@ -132,6 +132,16 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
return FALSE;
}
if (!TIFFSetDirectory( tif, (tdir_t)index ))
{
if (verbose)
wxLogError( _("Invalid TIFF image index.") );
TIFFClose( tif );
return FALSE;
}
uint32 w, h;
size_t npixels;
@@ -216,9 +226,24 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
return TRUE;
}
int wxTIFFHandler::GetImageCount( wxInputStream& stream )
{
TIFF *tif = TIFFwxOpen( stream, "image", "r" );
if (!tif)
return 0;
int dircount = 0; // according to the libtiff docs, dircount should be set to 1 here???
do {
dircount++;
} while (TIFFReadDirectory(tif));
TIFFClose( tif );
return dircount;
}
bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
bool wxTIFFHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose) )
{
return FALSE;
}