X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e30285abc6cb45d7e2cd66ddfe3eb460821f57ae..fd938b117780571129a03155ea0dc01fc73b7f23:/src/common/imagtiff.cpp?ds=sidebyside

diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp
index 741bc36472..657ff82ac5 100644
--- a/src/common/imagtiff.cpp
+++ b/src/common/imagtiff.cpp
@@ -136,6 +136,22 @@ _tiffUnmapProc(thandle_t WXUNUSED(handle),
 {
 }
 
+static void
+TIFFwxWarningHandler(const char* module, const char* fmt, va_list ap)
+{
+    if (module != NULL)
+            wxLogWarning(_("tiff module: %s"), module);
+    wxLogWarning((wxChar *) fmt, ap);
+}
+ 
+static void
+TIFFwxErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+    if (module != NULL)
+            wxLogError(_("tiff module: %s"), module);
+    wxVLogError((wxChar *) fmt, ap);
+}
+
 } // extern "C"
 
 TIFF*
@@ -162,6 +178,16 @@ TIFFwxOpen(wxOutputStream &stream, const char* name, const char* mode)
     return tif;
 }
 
+wxTIFFHandler::wxTIFFHandler()
+{
+    m_name = wxT("TIFF file");
+    m_extension = wxT("tif");
+    m_type = wxBITMAP_TYPE_TIF;
+    m_mime = wxT("image/tiff");
+    TIFFSetWarningHandler((TIFFErrorHandler) TIFFwxWarningHandler);
+    TIFFSetErrorHandler((TIFFErrorHandler) TIFFwxErrorHandler);
+}
+
 bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
 {
     if (index == -1)