compile
[kdegraphics.git] / thumbnailers / mobi / mobithumbnail.cpp
bloba9e18db9b46ca736d77d32e79c4a30091b990ae2
1 /***************************************************************************
2 * Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl> *
3 * *
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. *
8 ***************************************************************************/
10 #include "mobithumbnail.h"
11 #include "mobipocket.h"
12 #include "qfilestream.h"
14 #include <QtCore/QFile>
16 extern "C"
18 KDE_EXPORT ThumbCreator *new_creator()
20 return new MobiThumbnail;
24 bool MobiThumbnail::create(const QString &path, int width, int height, QImage &img)
26 Q_UNUSED(width);
27 Q_UNUSED(height);
29 Mobipocket::QFileStream f(path);
30 Mobipocket::Document doc(&f);
31 if (!doc.isValid()) return false;
32 img=doc.thumbnail();
33 return !img.isNull();
36 ThumbCreator::Flags MobiThumbnail::flags() const
38 return static_cast<Flags>(None);