Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
transfer-engine
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core
transfer-engine
Commits
3f2aecd7
Commit
3f2aecd7
authored
May 24, 2013
by
Marko Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review comment fixes
parent
501d3b4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
lib/imageoperation.cpp
lib/imageoperation.cpp
+1
-2
No files found.
lib/imageoperation.cpp
View file @
3f2aecd7
...
...
@@ -226,7 +226,6 @@ QString ImageOperation::scaleImageToSize(const QString &sourceFile, quint64 targ
QFileInfo
f
(
sourceFile
);
quint64
originalSize
=
f
.
size
();
if
(
originalSize
<=
targetSize
)
{
qWarning
()
<<
Q_FUNC_INFO
<<
"Target size can not be larger than the original size!"
;
return
QString
();
}
...
...
@@ -264,7 +263,7 @@ QString ImageOperation::scaleImageToSize(const QString &sourceFile, quint64 targ
qreal
r
=
w
/
(
h
*
1.0
);
// Aspect ratio
qreal
a
=
originalSize
/
(
w
*
h
*
1.0
);
// The magic number, which combines depth and compression
q
u
int32
newWidth
=
qSqrt
((
targetSize
*
r
)
/
a
);
qint32
newWidth
=
qSqrt
((
targetSize
*
r
)
/
a
);
QImage
scaled
=
tmpImage
.
scaledToWidth
(
newWidth
,
Qt
::
SmoothTransformation
);
if
(
!
scaled
.
save
(
tmpFile
))
{
...
...
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