yacreader/YACReaderLibrary/initial_comic_info_extractor.h
Luis Ángel San Martín a0dfa4e447 Limit max cover height
Otherwise we can end with huge cover files if the source content has abnormally tall covers. This large files could end exhausting RAM in the iOS client.
2022-08-29 20:04:00 +02:00

38 lines
912 B
C++

#ifndef INITIALCOMICINFOEXTRACTOR_H
#define INITIALCOMICINFOEXTRACTOR_H
#include <QtGui>
namespace YACReader {
class InitialComicInfoExtractor : public QObject
{
Q_OBJECT
public:
InitialComicInfoExtractor(QString fileSource, QString target = "", int coverPage = 1);
private:
QString _fileSource;
QString _target;
QString _currentName;
int _numPages;
QPair<int, int> _coverSize;
QImage _cover;
int _coverPage;
static bool crash;
QByteArray _xmlInfoData;
void saveCover(const QString &path, const QImage &cover);
public slots:
void extract();
int getNumPages() { return _numPages; }
QPixmap getCover() { return QPixmap::fromImage(_cover); }
QPair<int, int> getOriginalCoverSize() { return _coverSize; }
QByteArray getXMLInfoRawData();
signals:
void openingError(QProcess::ProcessError error);
};
}
#endif // INITIALCOMICINFOEXTRACTOR_H