summaryrefslogtreecommitdiff
path: root/src/lib/imagemagick_content.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/imagemagick_content.cc')
-rw-r--r--src/lib/imagemagick_content.cc46
1 files changed, 44 insertions, 2 deletions
diff --git a/src/lib/imagemagick_content.cc b/src/lib/imagemagick_content.cc
index cb712b417..f9572b518 100644
--- a/src/lib/imagemagick_content.cc
+++ b/src/lib/imagemagick_content.cc
@@ -1,5 +1,25 @@
+/*
+ Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
#include <libcxml/cxml.h>
#include "imagemagick_content.h"
+#include "imagemagick_decoder.h"
#include "compose.hpp"
#include "i18n.h"
@@ -11,8 +31,7 @@ ImageMagickContent::ImageMagickContent (boost::filesystem::path f)
: Content (f)
, VideoContent (f)
{
- /* XXX */
- _video_length = 10 * 24;
+
}
ImageMagickContent::ImageMagickContent (shared_ptr<const cxml::Node> node)
@@ -35,3 +54,26 @@ ImageMagickContent::valid_file (boost::filesystem::path f)
transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp");
}
+
+void
+ImageMagickContent::as_xml (xmlpp::Node* node) const
+{
+ node->add_child("Type")->add_child_text ("ImageMagick");
+ Content::as_xml (node);
+ VideoContent::as_xml (node);
+}
+
+void
+ImageMagickContent::examine (shared_ptr<Film> film, shared_ptr<Job> job, bool quick)
+{
+ Content::examine (film, job, quick);
+ shared_ptr<ImageMagickDecoder> decoder (new ImageMagickDecoder (film, shared_from_this()));
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ /* XXX */
+ _video_length = 10 * 24;
+ }
+
+ take_from_video_decoder (decoder);
+}