2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /** @file src/thumbs_job.cc
21 * @brief A job to create thumbnails.
25 #include "thumbs_job.h"
26 #include "film_state.h"
27 #include "tiff_encoder.h"
28 #include "transcoder.h"
32 using namespace boost;
34 /** @param s FilmState to use.
36 * @param l A log that we can write to.
38 ThumbsJob::ThumbsJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
45 ThumbsJob::name () const
47 return String::compose ("Update thumbs for %1", _fs->name);
54 shared_ptr<TIFFEncoder> e (new TIFFEncoder (_fs, _opt, _log));
55 Transcoder w (_fs, _opt, this, _log, e);
58 set_state (FINISHED_OK);
60 } catch (std::exception& e) {
63 set_error (e.what ());
64 set_state (FINISHED_ERROR);