// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "imagtiff.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxTIFFHandler,wxImageHandler)
+#if wxUSE_STREAMS
+
extern "C"
{
{
}
+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*
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)
(hdr[0] == 'M' && hdr[1] == 'M');
}
+#endif // wxUSE_STREAMS
-#endif
- // wxUSE_LIBTIFF
-
+#endif // wxUSE_LIBTIFF