+// helper to translate our, possibly 64 bit, wxFileOffset to TIFF, always 32
+// bit, toff_t
+static toff_t wxFileOffsetToTIFF(wxFileOffset ofs)
+{
+ if ( ofs == wxInvalidOffset )
+ return (toff_t)-1;
+
+ 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") );
+
+ return tofs;
+}
+
+// another helper to convert standard seek mode to our
+static wxSeekMode wxSeekModeFromTIFF(int whence)
+{
+ switch ( whence )
+ {
+ case SEEK_SET:
+ return wxFromStart;
+
+ case SEEK_CUR:
+ return wxFromCurrent;
+
+ case SEEK_END:
+ return wxFromEnd;
+
+ default:
+ return wxFromCurrent;
+ }
+}
+