Bug 141774 - autorotate does not work
Summary: autorotate does not work
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-PostProcessing (show other bugs)
Version: 0.9.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-16 09:37 UTC by David Holm
Modified: 2017-08-16 06:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Holm 2007-02-16 09:37:50 UTC
Version:           0.9.0 (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

When importing photos using the camera plugin the autorotation does not work... However if using the kipi autorotate plugins the images are rotated correctly. Furthermore show images/thumbs rotated according to orientation tag also works...
Comment 1 Luka Renko 2007-03-18 18:17:20 UTC
What kind of camera do you have? Does it have orientation sensor and has orientation presented in Exif?

It works here on Canon G3 and 400D with 0.9.1 on Kubuntu Feisty.
Comment 2 David Holm 2007-03-20 08:44:07 UTC
I have a Panasonic Lumix DMC-FX7 which does have an orientation sensor. As I wrote the autorotate works with the Kipi Autorotate plugin but NOT while downloading the images...
Comment 3 Thue Janus Kristensen 2007-05-04 13:55:31 UTC
I have a Canon PowerShot S3 IS, and the autorotate does not work for me either. It says "rotating" while downloading the images, but inside DigiKam the images are not rotated.

In addition, when I manually rotate the images inside DigiKam, it behaves strangely. The result of first manual rotation of an image is what it would have been if DigiKam had rotated the image correctly. So if the EXIF data says the image should be rotated 90 degrees, DigiKam shows it unrotated, but if I do a manual 90 degree rotation then suddenly the image is rotated 180 from the original unrotated image!
Comment 4 Benjamin Schindler 2007-07-10 12:18:57 UTC
I have this bug as well - Canon Powershot S2... I investigated a bit further and found this: 

Size of Exif metadata from camera = 10238
digikam: Exif header found at position 4
digikam: Exif autorotate: IMG_2789.JPG using (/home/benjamin/images/2007/Verschiedenes/.digikam-camera-tmp1-18185)
digikam: ExifRotate: not a JPEG file: /home/benjamin/images/2007/Verschiedenes/.digikam-camera-tmp1-18185
digikam: Dirty: /2007/Verschiedenes
digikam: Dirty: /

Looking at the code, it seems that this function here fails: 

bool isJpegImage(const QString& file)
{
    // Check if the file is an JPEG image
    KFileMetaInfo metaInfo(file, "image/jpeg", KFileMetaInfo::Fastest);

    if (metaInfo.isValid())
    {
        if (metaInfo.mimeType() == "image/jpeg")
            return true;
    }

    return false;
}

it seems that the metaInfo code does not work properly
Comment 5 Benjamin Schindler 2007-07-11 23:35:05 UTC
I have tested the patch we talked about on irc - using the newest svn version and rotate works there.
Comment 6 caulier.gilles 2007-07-11 23:47:01 UTC
Luka,

This is my chnages in svn to fix the problem:

http://websvn.kde.org/branches/extragear/kde3/graphics/digikam/libs/jpegutils/jpegutils.cpp?r1=675592&r2=686179

Feel free to patch Debian package by this way.

Nota: this patch sound like a big problem in low level KDE API which do not support multithreading (non-reentrance methods). We have already fight against this problem in the past (KDebug() for ex.)

I recommend to _never_ use low levels KDE API in multithreaded implementation. QT support multithreading very well, but not KDE.

Gilles Caulier
Comment 7 caulier.gilles 2007-07-11 23:50:00 UTC
David,

You have done the original post of this problem in this room. I would to have your feedback before to close this file.

Please, try current svn implementation of digiKam dedicaced to KDE3, or try to apply my patch against 0.9.2 source code on your computer. Thanks in advance

Gilles Caulier
Comment 8 caulier.gilles 2007-08-22 09:33:13 UTC
Benjamin have tested current fix on svn. I close this file now.

Gilles Caulier