]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtiff.cpp
Include compilation of tests for OpenVMS (part2)
[wxWidgets.git] / src / common / imagtiff.cpp
index 13606aeffebf036e849f63a0f29926cda8801d90..5d8476daec91218bb557fb0a0082462a5af75270 100644 (file)
@@ -25,6 +25,7 @@
 #if wxUSE_IMAGE && wxUSE_LIBTIFF
 
 #include "wx/imagtiff.h"
+#include "wx/versioninfo.h"
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
@@ -126,7 +127,7 @@ static toff_t wxFileOffsetToTIFF(wxFileOffset ofs)
 
     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;
 }
@@ -448,7 +449,7 @@ int wxTIFFHandler::DoGetImageCount( wxInputStream& stream )
     } while (TIFFReadDirectory(tif));
 
     TIFFClose( tif );
-    
+
     // NOTE: this function modifies the current stream position but it's ok
     //       (see wxImageHandler::GetImageCount)
 
@@ -482,7 +483,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
     switch ( res )
     {
         default:
-            wxFAIL_MSG( _T("unknown image resolution units") );
+            wxFAIL_MSG( wxT("unknown image resolution units") );
             // fall through
 
         case wxIMAGE_RESOLUTION_NONE:
@@ -627,4 +628,27 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream )
 
 #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, &micro) != 3 )
+    {
+        wxLogDebug("Unrecognized libtiff version string \"%s\"", ver);
+
+        major =
+        minor =
+        micro = 0;
+    }
+
+    wxString copyright;
+    const wxString desc = ver.BeforeFirst('\n', &copyright);
+    copyright.Replace("\n", "");
+
+    return wxVersionInfo("libtiff", major, minor, micro, desc, copyright);
+}
+
 #endif  // wxUSE_LIBTIFF