]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/image.h
Prevent seg fault for older GTK+
[wxWidgets.git] / include / wx / image.h
index b1d7eea62a89a3c29a038b8d14f68bac365806cc..afcbaf95c2fd16492ff7b7554cf411ab50101ae6 100644 (file)
 #define wxIMAGE_OPTION_RESOLUTIONUNIT        wxString(_T("ResolutionUnit"))
 
 // constants used with wxIMAGE_OPTION_RESOLUTIONUNIT
-enum
+//
+// NB: don't change these values, they correspond to libjpeg constants
+enum wxImageResolution
 {
+    // Resolution not specified
+    wxIMAGE_RESOLUTION_NONE = 0,
+
+    // Resolution specified in inches
     wxIMAGE_RESOLUTION_INCHES = 1,
+
+    // Resolution specified in centimeters
     wxIMAGE_RESOLUTION_CM = 2
 };
 
@@ -112,6 +120,13 @@ protected:
     bool CallDoCanRead(wxInputStream& stream);
 #endif // wxUSE_STREAMS
 
+    // helper for the derived classes SaveFile() implementations: returns the
+    // values of x- and y-resolution options specified as the image options if
+    // any
+    static wxImageResolution
+    GetResolutionFromOptions(const wxImage& image, int *x, int *y);
+
+
     wxString  m_name;
     wxString  m_extension;
     wxString  m_mime;