summaryrefslogtreecommitdiff
path: root/src/lib/imagemagick_content.cc
blob: d096bff847f199fd68b852cc55e9dbbc463135ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "imagemagick_content.h"
#include "compose.hpp"

#include "i18n.h"

using std::string;

ImageMagickContent::ImageMagickContent (boost::filesystem::path f)
	: Content (f)
	, VideoContent (f)
{
	/* XXX */
	_video_length = 10 * 24;
}

string
ImageMagickContent::summary () const
{
	return String::compose (_("Image: %1"), file().filename ());
}

bool
ImageMagickContent::valid_file (boost::filesystem::path f)
{
	string ext = f.extension().string();
	transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
	return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp");
}