Commit 31565cb5 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factorize

parent a53c6ed1
...@@ -64,9 +64,9 @@ namespace KIPIHTMLExport ...@@ -64,9 +64,9 @@ namespace KIPIHTMLExport
*/ */
static QImage generateThumbnail(const QImage& fullImage, int size, bool square) static QImage generateThumbnail(const QImage& fullImage, int size, bool square)
{ {
QImage image = fullImage.scaled(size, size, QImage image = fullImage.scaled(size, size, square ? Qt::KeepAspectRatioByExpanding
square ? Qt::KeepAspectRatioByExpanding : Qt::KeepAspectRatio, : Qt::KeepAspectRatio,
Qt::SmoothTransformation); Qt::SmoothTransformation);
if (square && (image.width() != size || image.height() != size)) if (square && (image.width() != size || image.height() != size))
{ {
...@@ -99,15 +99,12 @@ void ImageGenerationFunctor::operator()(ImageElement& element) ...@@ -99,15 +99,12 @@ void ImageGenerationFunctor::operator()(ImageElement& element)
return; return;
} }
QImage originalImage; QImage originalImage;
QString imageFormat;
// Check if RAW file.
QFileInfo fi(path);
QString rawFilesExt(KDcraw::rawFiles());
QString imageFormat;
QByteArray imageData; QByteArray imageData;
if (rawFilesExt.toUpper().contains(fi.suffix().toUpper()) && !mInfo->useOriginalImageAsFullImage()) // Check if RAW file.
if (KPMetadata::isRawFile(path))
{ {
if (!KDcraw::loadDcrawPreview(originalImage, path)) if (!KDcraw::loadDcrawPreview(originalImage, path))
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment