#if wxUSE_IMAGE && wxUSE_LIBTIFF
#include "wx/imagtiff.h"
+#include "wx/versioninfo.h"
#ifndef WX_PRECOMP
#include "wx/log.h"
toff_t tofs = wx_truncate_cast(toff_t, ofs);
wxCHECK_MSG( (wxFileOffset)tofs == ofs, (toff_t)-1,
- _T("TIFF library doesn't support large files") );
+ wxT("TIFF library doesn't support large files") );
return tofs;
}
} while (TIFFReadDirectory(tif));
TIFFClose( tif );
-
+
// NOTE: this function modifies the current stream position but it's ok
// (see wxImageHandler::GetImageCount)
switch ( res )
{
default:
- wxFAIL_MSG( _T("unknown image resolution units") );
+ wxFAIL_MSG( wxT("unknown image resolution units") );
// fall through
case wxIMAGE_RESOLUTION_NONE:
#endif // wxUSE_STREAMS
+/*static*/ wxVersionInfo wxTIFFHandler::GetLibraryVersionInfo()
+{
+ int major,
+ minor,
+ micro;
+
+ const wxString ver(::TIFFGetVersion());
+ if ( wxSscanf(ver, "LIBTIFF, Version %d.%d.%d", &major, &minor, µ) != 3 )
+ {
+ wxLogDebug("Unrecognized libtiff version string \"%s\"", ver);
+
+ major =
+ minor =
+ micro = 0;
+ }
+
+ wxString copyright;
+ const wxString desc = ver.BeforeFirst('\n', ©right);
+ copyright.Replace("\n", "");
+
+ return wxVersionInfo("libtiff", major, minor, micro, desc, copyright);
+}
+
#endif // wxUSE_LIBTIFF