[KimDaBa] Problem with Read EXIF Information from Files

Robert L Krawitz rlk at alum.mit.edu
Sat Jan 8 01:06:42 GMT 2005


As part of debugging the problem reading the .thm files, I tried
running this.  I have a number of JPEG files which I scanned a few
months ago (and therefore the file modification time is recent), but
which were taken in 1996 and which I back dated to then.  These files
have no EXIF information.  However, when I ran Read EXIF Information
from Files (to try to extract the orientation information), the dates
on these images were reset.

I don't know if it's related (indirectly) to this assertion I'm
getting:

ASSERT: "false" in fileinfo.cpp (85)

which is what happens when the orientation is something unexpected.
My guess is that the fact that the image doesn't contain EXIF
information is somehow being ignored, both in the case of orientation
and in the case of date/time.

int FileInfo::angle( bool* found ) const
{
    if ( !_map.contains(QString::fromLatin1( "Orientation" )) ) {
        if ( found )
            found = false;
        return 0;
    }

    if ( found )
        *found = true;

    int orientation =  _map[QString::fromLatin1( "Orientation" )].toInt();
    if ( orientation == 1 || orientation == 2 )
        return 0;
    else if ( orientation == 3 || orientation == 4 )
        return 180;
    else if ( orientation == 5 || orientation == 8 )
        return 270;
    else if ( orientation == 6 || orientation == 7 )
        return 90;
    else {
        Q_ASSERT( false );
        return 0;
    }
}



More information about the Kphotoalbum mailing list