]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtiff.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / common / imagtiff.cpp
index 68bfd86c0f6b91849ac13c5a1e08a5dccf7b79a8..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"
@@ -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)
 
@@ -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