Version: 0.10 latest svn (using KDE 4.1.3) OS: Linux Installed from: Ubuntu Packages Hi, I used the svn version of exiv2 and today I updated to exiv2 0.18, in both cases I get the Error dialog "Failed to revise Exif orientation" then changing the orientation of PEF-files of my Pentax K100D, but the orientation is changed correctly, so just the dialog should not appear... greets, mike
Are there any error messages prined on the console when you change orientation? DMetadata::apply sees a reason to signal failure here.
here is the output: digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Preview data size: 2281421 digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Using embedded RAW preview extraction digikam(6733) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 1 digikam(6733) Digikam::AlbumIconView::slotSetExifOrientation: Setting Exif Orientation tag to 8 digikam(6733) KExiv2Iface::KExiv2::setImageOrientation: Exif.Image.Orientation tag set to: 8 digikam(6733) KExiv2Iface::KExiv2Priv::printExiv2ExceptionError: Cannot save metadata using Exiv2 (Error # 2 : /media/E/DCIM/143/IMGP1623.PEF6733: (1) (chmod) digikam(6733) Digikam::AlbumManager::slotDirty: AlbumManager::slotDirty "/media/E/DCIM/143" digikam(6733) Digikam::DImg::load: "/media/E/DCIM/143/IMGP1623.PEF" : RAW file identified digikam(6733) Digikam::ScanControllerLoadingCacheFileWatch::slotImageChanged: 4220 "/media/E/DCIM/143/IMGP1623.PEF" digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Preview data size: 1630793 digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Preview data size: 1630793 digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Using embedded RAW preview extraction digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Using embedded RAW preview extraction digikam(6733) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 8 digikam(6733) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 8 digikam(6733) Digikam::AlbumManager::slotDirty: AlbumManager::slotDirty "/media/E/DCIM" digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Preview data size: 1630793 digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Preview data size: 1630793 digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Using embedded RAW preview extraction digikam(6733) KDcrawIface::KDcraw::loadEmbeddedPreview: Using embedded RAW preview extraction digikam(6733) Digikam::AlbumManager::slotDirty: AlbumManager::slotDirty "/media/E/DCIM" digikam(6733) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 8 digikam(6733) Digikam::AlbumManager::slotDirty: Filtering out db-file-triggered dir watch signal digikam(6733) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 8 greets mike
Gilles, do you know why this exception from exiv2 is thrown: digikam(6733) KExiv2Iface::KExiv2Priv::printExiv2ExceptionError: Cannot save metadata using Exiv2 (Error # 2 : /media/E/DCIM/143/IMGP1623.PEF6733: (1) (chmod)
No, but Andreas certainly... Gilles
I don't think that message is from Exiv2... -ahu.
Andreas, digikam(6733) KExiv2Iface::KExiv2Priv::printExiv2ExceptionError: << libkexiv2 Cannot save metadata using Exiv2 << libkexiv2 (Error # 2 : /media/E/DCIM/143/IMGP1623.PEF6733: (1) (chmod) << Exiv2 Dixit these lines from source code : http://lxr.kde.org/source/KDE/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2.cpp#428 http://lxr.kde.org/source/KDE/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2private.cpp#044 Gilles
Oh, ok, now I get it. The error message means that the system call to chmod() failed (with rc == -1) for the given file and errno is 1. The error message actually also includes a textual description of the system error before '(1)', but that is empty here. This happens in FileIo::transfer, presumably called from TiffImage::writeMetadata in this case (based on the file name). When the file is written, it is saved to a temporary file first. Then the temporary file is renamed to the original filename and the original permissions are applied to the new file. The actual implementation is a bit more complicated: http://dev.exiv2.org/repositories/entry/exiv2/trunk/src/basicio.cpp#L217 What are the permissions of the original file and that of the directory? What filesystem is this on? Andreas
Since I needed the compatibility to windows, the files are on a ntfs volume, belong to root and the group plugdev has read and write rights, everything with ubuntu 8.10, the partition is mounted with "ntfs defaults,umask=007,gid=46 0 1" greets, mike
Mike, What happens if you do this from the command line as the user which you use to run digiKam: + create a new file in the same directory as the image files (eg, "touch ttt") + change the permissions of that file to those of the images (chmod) + echo $? Does the chmod succeed? -ahu.
hi andreas, I hope I did it right, but it didn't succeed. I got "chmod: Beim Setzen der Zugriffsrechte für „ttt“: Operation not permitted" and "1". greets, mike
Mike, Good. That reproduces the error that you get in digiKam. But do you understand why you can't change the permissions? What are the permissions of the images, the ttt file and the directory? cd /the/directory ls -lad . ls -la ttt ls -la <image> (I could simply remove the check for success of chmod in Exiv2, since it is the last operation. But I'd like to understand what's the root cause of the problem before modifying anything.) Andreas
If you google for it you will find at least some forum posts stating that chmod is not / not fully supported / read only for NTFS.
hi, here is the output. I hope it helps. I can read and write on that NTFS volume. drwxrwx--- 1 root plugdev 16384 2008-12-01 20:14 . -rwxrwx--- 1 root plugdev 0 2008-12-30 00:39 ttt -rwxrwx--- 1 root plugdev 10446538 2007-06-09 18:47 IMGP1441.PEF greets, mike
I can fully reproduce this here: chmod'ing a file on an NTFS partition (mounted with ntfs-3g) as non-superuser fails with errno=1, regardless of seemingly sufficient privileges in the directory. Doing the same as superuser does not give an error, but gives no effect either, i.e. permissions are unchanged. whoami marcel groups users dialout video dir -d /windows/Users/marcel/Pictures/ drwxrwxr-x 1 root users 0 24. Dez 23:03 /windows/Users/marcel/Pictures/ dir /windows/Users/marcel/Pictures/ insgesamt 5 -rw-rw-r-- 1 root users 674 24. Dez 23:03 desktop.ini -rw-rw-r-- 2 root users 669 24. Dez 23:03 Sample Pictures.lnk LANG=C chmod a-w /windows/Users/marcel/Pictures/Sample\ Pictures.lnk chmod: changing permissions of `/windows/Users/marcel/Pictures/Sample Pictures.lnk': Operation not permitted
http://dev.exiv2.org/repositories/diff/exiv2?rev=1719 + do not chmod if the permissions of the new file are the same as those of the old file + do not throw if stat or chmod fails here, just issue a warning + use correct version of strerror_r when compiling with g++ Marcel, Mike, Can you please try if this fixes the problem for you? Marcel, I would appreciate if you had a look at the code changes too - as a sanity check. Thanks! Andreas
Your changes look all right to me.
For me code sound fine now (patch not tested with NTFS). Michael, can you test using last Exiv2 code from svn, and recompile libkexiv2 from trunk using it and test again with digiKam. thanks in advance. Gilles Caulier
works fine for me... thank you all and happy new year ;-) greets, mike