[Bug 203512] Full-size thumbnails are saved under .thumbnails/normal
Brendon Higgins
blhiggins at gmail.com
Thu Aug 13 06:53:11 BST 2009
https://bugs.kde.org/show_bug.cgi?id=203512
--- Comment #7 from Brendon Higgins <blhiggins gmail com> 2009-08-13 07:53:09 ---
I think the problem is createSubThumbnail in thumbnail.cpp:
if (subCreator->create(filePath, cacheSize, cacheSize, thumbnail)) {
// The thumbnail has been created successfully. Store the thumbnail
// to the cache for future access.
KTemporaryFile temp;
temp.setPrefix(thumbPath + "kde-tmp-");
temp.setSuffix(".png");
temp.setAutoRemove(false);
if (temp.open()) {
tempFileName = temp.fileName();
savedCorrectly = thumbnail.save(tempFileName, "PNG");
}
} else {
return false;
}
This creates a thumbnail for use as a sub-thumbnail for in the generation of
folder thumbnails, but it performs no size checking on the image that's created
by the sub-thumbnail generator.
ImageCreator::create seems to return the image without scaling. Presumably the
assumption is that this is safe because the get method in thumbnail.cpp does
this:
if (img.width() > m_width || img.height() > m_height) {
double imgRatio = (double)img.height() / (double)img.width();
if (imgRatio > (double)m_height / (double)m_width) {
img = img.scaled( int(qMax((double)m_height / imgRatio, 1.0)),
m_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
} else {
img = img.scaled(m_width, int(qMax((double)m_width * imgRatio, 1.0)),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
}
createSubThumbnail doesn't do that.
If I'm correct, then this is how unscaled images work their way into the
thumbnails folder.
Peace,
Brendon
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list