Summary: | Digikam-0.8.2-rc1 thumbnails does not adhere to the Rotate Images setting in Configure Digikam | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Magnus Larsson <magnus.larsson.k> |
Component: | Thumbs-Image | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | The new batch thumbs processing tool in action from digikam 0.9.0-beta2 |
Description
Magnus Larsson
2006-05-11 23:22:07 UTC
The pictures used in the tests are all jpg straight from a Canon EOS-350D camera. Best regards, Magnus Larsson Magnus, please join your images like attachments in this thread to process tests. Thanks in advance Gilles Caulier Dear Gilles Caulier, Please find a test picture attached, as per request. http://gunnarlarsson.scorpionshops.com/DigiKam-test/img_1511.jpg Best regards Magnus Larsson Dear Digikam community, A correction. Please find new test pictures attached. http://gunnarlarsson.scorpionshops.com/DigiKam-test img_1511--digikam-copy-function.jpg img_1511-straight-from-camera.jpg The http://bugs.kde.org/show_bug.cgi?id=127179#c2 img_1511.jpg picture originally posted was NOT straight from the camera. It was created using the Digikam "copy" function and then pasted into the web server directory. It is renamed img_1511--digikam-copy-function.jpg. The img_1511-straight-from-camera.jpg is what it says. 0.8.1 img_1511-straight-from-camera.jpg Rotate Images setting on off OK (Portrait) OK (Landscape) 0.8.2-rc1 img_1511-straight-from-camera.jpg Rotate Images setting on off NOK (Landscape) OK (Landscape) Best regards, Magnus Larsson I have tested the test pictures and it kind of works for me. But not without pain... Note that cached thumbnails can disturb the function. Remove cached thumbnails, between testruns, with: find ~/.thumbnails/ -name "*.png" | xargs -n 10 rm Also note that konqueror uses the same cache! If the images are viewed first in konqueror (that does not rotate) then later viewing by digikam will be wrong. (kthumbnail). Magnus does this explain your problems? But an additional problem exist - the embedded thumbnail is already rotated by some cameras. Like Canon A520. There is an option in konqueror for this... I guess we really would like to: - Use embedded thumbnail if it exist to speed up icon view. I see no actual reason to have this user configurable, other than as a temporal work around. - Be able to select if we want _thumbnail_ to be shown as native as camera sees it or attempt to rotate using EXIF information. It is technically possible to save the thumbnail in native form and add a Orientation tag to the file... - Use only one set of options for both konqueror and digikam (or use two sets of thumbnails). On option change - clean up cache if needed. Suppose we forget cameras with prerotated thumbnails for a while, where would the above functions be placed? I would suggest imagethumbnail.so To get perfect function additional info per camera model will be needed - it can not be a configuration option since one user might have several cameras that behaves differently. This info can be stored in imagethumbnail.so to (or an config file to go with it). Cameras that prerotate embedded thumbnail can be identified automatically if the any embedded thumbnail is higher than it is wide. (This will fail for all picture taken upside down before first portrait - not bad) Mr Roger Larsson,
I have tested to remove the thumbnails between tests.
>Note that cached thumbnails can disturb the function.
> Remove cached thumbnails, between testruns, with:
>
> find ~/.thumbnails/ -name "*.png" | xargs -n 10 rm
>
>Also note that konqueror uses the same cache!
>If the images are viewed first in konqueror (that
>does not rotate) then later viewing by digikam
>will be wrong. (kthumbnail).
>Magnus does this explain your problems?
Yes, you are correct.
1) remove thumbnails as per instruction above.
2) set rotation config parameter
3) go to album in order to generate thumbnails.
=> result: thumbnails and viewer are configured in a correct way.
4) counter test: reset the config rotation parameter
=> result: the thumbnails are NOT changed according to the parameter.
The thumbnails are nor re-generated.
I still consider the 0.8.2-rc1 behavior as a regression error.
The 0.8.1 version regenerates the thumbnails using the rotation parameter when changed, instantly, 0.8.2-rc1 does not. It keeps the old thumbnails once created (for me at least).
I am using Kipi lib 0.1.2.
Best regards,
Magnus Larsson
this bug exist in 0.9.0 beta 1. it does not show images the right way; neither thumbs nor in showfoto. [removing thumbnail cache does not helps] thanks, Aew SVN commit 578815 by cgilles: digikam from trunk : When the Exif auto-rotation option is canged in setup dialog, digiKam ask now to user if the new batch tool to re-generate all albums items thumbnails must be started to refresh thumbs database. CCBUGS: 127179, 110658, 128308 M +16 -0 setup.cpp M +25 -5 setupmetadata.cpp M +4 -1 setupmetadata.h --- trunk/extragear/graphics/digikam/utilities/setup/setup.cpp #578814:578815 @@ -30,11 +30,13 @@ #include <klocale.h> #include <kiconloader.h> +#include <kmessagebox.h> #include <kconfig.h> #include <kapplication.h> // Local includes. +#include "batchthumbsgenerator.h" #include "setupgeneral.h" #include "setupmetadata.h" #include "setupidentity.h" @@ -214,6 +216,20 @@ d->slideshowPage->applySettings(); d->iccPage->applySettings(); d->miscPage->applySettings(); + + if (d->metadataPage->exifAutoRotateAsChanged()) + { + QString msg = i18n("The Exif auto-rotate thumbnails option has been changed.\n" + "Do you want to rebuild all albums items thumbnails now?\n\n" + "Note: thumbnails processing can take a while!"); + int result = KMessageBox::warningYesNo(this, msg); + if (result != KMessageBox::Yes) + return; + + BatchThumbsGenerator *thumbsGenerator = new BatchThumbsGenerator(this); + thumbsGenerator->exec(); + } + close(); } --- trunk/extragear/graphics/digikam/utilities/setup/setupmetadata.cpp #578814:578815 @@ -58,6 +58,7 @@ SetupMetadataPriv() { + ExifAutoRotateAsChanged = false; saveCommentsBox = 0; ExifRotateBox = 0; ExifSetOrientationBox = 0; @@ -68,6 +69,9 @@ saveCreditsIptcBox = 0; } + bool ExifAutoRotateAsChanged; + bool ExifAutoRotateOrg; + QCheckBox *saveCommentsBox; QCheckBox *ExifRotateBox; QCheckBox *ExifSetOrientationBox; @@ -163,16 +167,18 @@ mainLayout->addWidget(hbox); mainLayout->addStretch(); + mainLayout->addWidget(this); + readSettings(); + adjustSize(); + // -------------------------------------------------------- connect(exiv2LogoLabel, SIGNAL(leftClickedURL(const QString&)), this, SLOT(processExiv2URL(const QString&))); - readSettings(); - adjustSize(); - - mainLayout->addWidget(this); + connect(d->ExifRotateBox, SIGNAL(toggled(bool)), + this, SLOT(slotExifAutoRotateToggled(bool))); } SetupMetadata::~SetupMetadata() @@ -207,7 +213,8 @@ AlbumSettings* settings = AlbumSettings::instance(); if (!settings) return; - d->ExifRotateBox->setChecked(settings->getExifRotate()); + d->ExifAutoRotateOrg = settings->getExifRotate(); + d->ExifRotateBox->setChecked(d->ExifAutoRotateOrg); d->ExifSetOrientationBox->setChecked(settings->getExifSetOrientation()); d->saveCommentsBox->setChecked(settings->getSaveComments()); d->saveDateTimeBox->setChecked(settings->getSaveDateTime()); @@ -217,6 +224,19 @@ d->saveCreditsIptcBox->setChecked(settings->getSaveIptcCredits()); } +bool SetupMetadata::exifAutoRotateAsChanged() +{ + return d->ExifAutoRotateAsChanged; +} + +void SetupMetadata::slotExifAutoRotateToggled(bool b) +{ + if ( b != d->ExifAutoRotateOrg) + d->ExifAutoRotateAsChanged = true; + else + d->ExifAutoRotateAsChanged = false; +} + } // namespace Digikam #include "setupmetadata.moc" --- trunk/extragear/graphics/digikam/utilities/setup/setupmetadata.h #578814:578815 @@ -43,13 +43,16 @@ void applySettings(); + bool exifAutoRotateAsChanged(); + private: void readSettings(); private slots: - void processExiv2URL(const QString& url); + void processExiv2URL(const QString&); + void slotExifAutoRotateToggled(bool); private: SVN commit 579297 by cgilles: digikam from trunk : with showfoto, refresh all thumbbar items if exif auto-rotation option is changed in setup CCBUGS: 127179 M +30 -1 thumbbar.cpp --- trunk/extragear/graphics/digikam/libs/thumbbar/thumbbar.cpp #579296:579297 @@ -22,12 +22,20 @@ * * ============================================================ */ +// C Ansi includes. + +extern "C" +{ +#include <unistd.h> +} + // C++ includes. #include <cmath> // Qt includes. - + +#include <qdir.h> #include <qpixmap.h> #include <qtimer.h> #include <qpainter.h> @@ -38,6 +46,7 @@ // KDE includes. +#include <kmdcodec.h> #include <kfileitem.h> #include <kapplication.h> #include <kiconloader.h> @@ -138,6 +147,26 @@ void ThumbBarView::setExifRotate(bool exifRotate) { d->exifRotate = exifRotate; + QString thumbCacheDir = QDir::homeDirPath() + "/.thumbnails/"; + + for (ThumbBarItem *item = d->firstItem; item; item = item->m_next) + { + // Remove all current album item thumbs from disk cache. + + QString uri = "file://" + QDir::cleanDirPath(item->url().path(-1)); + KMD5 md5(QFile::encodeName(uri)); + uri = md5.hexDigest(); + + QString smallThumbPath = thumbCacheDir + "normal/" + uri + ".png"; + QString bigThumbPath = thumbCacheDir + "large/" + uri + ".png"; + + ::unlink(QFile::encodeName(smallThumbPath)); + ::unlink(QFile::encodeName(bigThumbPath)); + + invalidateThumb(item); + } + + triggerUpdate(); } int ThumbBarView::countItems() Hey guy, In svn trunk (next digikam 0.9.0-beta2 planed during september), we have fixed a lot of problems with thumbnails. There is also a new batch thumbnails processing tool to update the thumbs database on the disk (no need to play with your ~/.thumbnails folder anymore. Can you give us a feedback with the current implementation ? Thanks in advance Gilles Caulier Created attachment 17591 [details]
The new batch thumbs processing tool in action from digikam 0.9.0-beta2
Magnus, digikam and Exiv2 library Exif rotation tag management have been fixed. Please test current digiKam implementation from svn (0.9.2-svn) with Exiv2 0.14 Thanks in advance Gilles Caulier Magnus, could you check the problem with 0.9.2-beta3 and Exiv2 0.14? It would be nice to have the issue fully resolved before the final release of 0.9.2 (which is going to happen soon!). Many thanks in advance, Arnd I am closing this bug, marking as FIXED. Please feel free to re-open if there is any new information. Arnd |