summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-11-14 21:58:47 +0000
committerCarl Hetherington <cth@carlh.net>2012-11-14 21:58:47 +0000
commit967dc3f4461d4b8caf809ebce7bdcb6e818809f0 (patch)
treec599bad3a8a3797ccdc3d25963059a668baa6649 /src/lib/util.cc
parent05c37b9bb09f7bfa4c2ec8ea6b3fa4a83d0fec20 (diff)
Use ImageMagick for tiff decoding too.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 5e82650a5..862ddc111 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -37,6 +37,7 @@
#include <boost/lambda/lambda.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/thread.hpp>
+#include <boost/filesystem.hpp>
#include <openjpeg.h>
#include <openssl/md5.h>
#include <magick/MagickCore.h>
@@ -827,3 +828,17 @@ video_frames_to_audio_frames (SourceFrame v, float audio_sample_rate, float fram
{
return ((int64_t) v * audio_sample_rate / frames_per_second);
}
+
+bool
+still_image_file (string f)
+{
+#if BOOST_FILESYSTEM_VERSION == 3
+ string ext = boost::filesystem::path(f).extension().string();
+#else
+ string ext = boost::filesystem::path(f).extension();
+#endif
+
+ transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
+
+ return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png");
+}