blob: cb712b417fa3bb73f4b88649804ef6fe3c08a5e7 (
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
29
30
31
32
33
34
35
36
37
|
#include <libcxml/cxml.h>
#include "imagemagick_content.h"
#include "compose.hpp"
#include "i18n.h"
using std::string;
using boost::shared_ptr;
ImageMagickContent::ImageMagickContent (boost::filesystem::path f)
: Content (f)
, VideoContent (f)
{
/* XXX */
_video_length = 10 * 24;
}
ImageMagickContent::ImageMagickContent (shared_ptr<const cxml::Node> node)
: Content (node)
, VideoContent (node)
{
}
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");
}
|