1 /*
2 This file is part of kde-thumbnailer-epub
3 Copyright (C) 2012-2017 Giacomo Barazzetti <giacomosrv@gmail.com>
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "epubthumbnail.h"
20 #include "epub.h"
21 
22 #include <QtGui/QImage>
23 
24 extern "C"
25 {
new_creator()26     Q_DECL_EXPORT ThumbCreator *new_creator()
27     {
28         return new EPUBCreator();
29     }
30 }
31 
create(const QString & path,int,int,QImage & img)32 bool EPUBCreator::create(const QString &path, int /*width*/, int /*height*/, QImage &img)
33 {
34     Epub epubFile(path);
35 
36     if (epubFile.open()) {
37         epubFile.getCoverImage(img);
38     }
39 
40     return !img.isNull();
41 }
42 
flags() const43 ThumbCreator::Flags EPUBCreator::flags() const
44 {
45     return None;
46 }
47