[Kde-imaging] [Bug 144604] Rotation causes Exif data corruption

Gilles Caulier caulier.gilles at gmail.com
Thu Apr 26 20:25:16 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=144604         




------- Additional Comments From caulier.gilles gmail com  2007-04-26 20:25 -------
Andreas,

This is the method from libkexiv2 used to update image dimensions after rotation :

bool KExiv2::setImageDimensions(const QSize& size, bool setProgramName)
{
    if (!setProgramId(setProgramName))
        return false;

    try
    {    
        d->exifMetadata["Exif.Image.ImageWidth"]      = size.width();
        d->exifMetadata["Exif.Image.ImageLength"]     = size.height();
        d->exifMetadata["Exif.Photo.PixelXDimension"] = size.width();
        d->exifMetadata["Exif.Photo.PixelYDimension"] = size.height();
        return true;
    }
    catch( Exiv2::Error &e )
    {
        printExiv2ExceptionError("Cannot set image dimensions using Exiv2 ", e);
    }        
    
    return false;
}

Full code from libkexiv2 is here :

http://websvn.kde.org/trunk/extragear/libs/libkexiv2/kexiv2.cpp?revision=646581&view=markup

The QSize::width() or QSize::height() method return an integer value.

The code is simple and the problem reported by Isaac is reproductible on my computer. After to rotate an image, the tags type is SLONG.

I have not yet tried to play with Exiv2 command line tool. I will do it. Isac can you perform a test with EXiv2 command line tool too to trying to reproduce the problem ?

Gilles


More information about the Kde-imaging mailing list