Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Kipi Plugins
Commits
31565cb5
Commit
31565cb5
authored
Apr 26, 2012
by
Gilles Caulier
🗼
Browse files
factorize
parent
a53c6ed1
Changes
1
Show whitespace changes
Inline
Side-by-side
htmlexport/imagegenerationfunctor.cpp
View file @
31565cb5
...
@@ -64,8 +64,8 @@ namespace KIPIHTMLExport
...
@@ -64,8 +64,8 @@ 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
))
...
@@ -100,14 +100,11 @@ void ImageGenerationFunctor::operator()(ImageElement& element)
...
@@ -100,14 +100,11 @@ void ImageGenerationFunctor::operator()(ImageElement& element)
}
}
QImage
originalImage
;
QImage
originalImage
;
// Check if RAW file.
QFileInfo
fi
(
path
);
QString
rawFilesExt
(
KDcraw
::
rawFiles
());
QString
imageFormat
;
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
))
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment