Summary: | Pictures files are updated (but not modified) when setting new metadatas albeit they are unset | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Fabien <fabien.ubuntu> |
Component: | Setup-Metadata | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 0.9.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 |
Description
Fabien
2006-12-08 16:33:44 UTC
>Why trying to save metadata (digikam is configured to not save metadata to image file) ?
> Well, I guess that's the bug :)
Because digiKam check only the right permission of file, not album...
Gilles
SVN commit 612751 by cgilles: digikam from trunk : if file dir-path is read-only, do not try to save metadata on pictures. BUG: 138540 M +11 -4 dmetadata.cpp --- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #612750:612751 @@ -349,14 +349,21 @@ bool DMetadata::save(const QString& filePath, DImg::FORMAT ff) { - // NOTE: see B.K.O #137770 : never touch the file if is read only. - QFileInfo info(filePath); - if (!info.isWritable()) + // NOTE: see B.K.O #137770 & #138540 : never touch the file if is read only. + QFileInfo finfo(filePath); + QFileInfo dinfo(finfo.dirPath()); + if (!finfo.isWritable()) { - DDebug() << "File '" << info.fileName() << "' is read-only. Metadata not saved." << endl; + DDebug() << "File '" << finfo.fileName() << "' is read-only. Metadata not saved." << endl; return false; } + if (!dinfo.isWritable()) + { + DDebug() << "Dir '" << finfo.filePath() << "' is read-only. Metadata not saved." << endl; + return false; + } + switch (ff) { case(DImg::JPEG): SVN commit 612755 by cgilles: kipi-plugins from trunk : if file dir-path is read-only, do not try to save metadata on pictures. CCBUGS: 138540 M +10 -4 exiv2iface.cpp --- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp #612754:612755 @@ -282,13 +282,19 @@ if (filePath.isEmpty()) return false; - // NOTE: see B.K.O #137770 : never touch the file if is read only. - QFileInfo info(filePath); - if (!info.isWritable()) + // NOTE: see B.K.O #137770 & #138540 : never touch the file if is read only. + QFileInfo finfo(filePath); + QFileInfo dinfo(finfo.dirPath()); + if (!finfo.isWritable()) { - kdDebug() << "File '" << info.fileName() << "' is read-only. Metadata not saved." << endl; + kdDebug() << "File '" << finfo.fileName() << "' is read-only. Metadata not saved." << endl; return false; } + if (!dinfo.isWritable()) + { + kdDebug() << "Dir '" << dinfo.filePath() << "' is read-only. Metadata not saved." << endl; + return false; + } try { Thanks a lot Gilles ! Now, it's getting better :) But, I'm going to ask you one more thing ;-) Since the beginning, my concern is to avoid any action to a file if there's no reason to touch it. Even with your latest modification, the file is still touched even if there's nothing to do on it. If I'm not wrong (as I don't know C++), it looks like in file digikam/libs/imageproperties/imagedescedittab.cpp there's something that could be changed about : ImageDescEditTab::applyAllChanges() You check each setting before setting new metadata, but at the end, in all case, you do a "metadata.applyChanges();". So, maybe it could be possible to check if there's at least one modification in the different metadatas and then avoid the applyChanges if there's nothing to apply. I hope I'm not too wrong ;-) Fabien, I just need some holidays (:=))). I have forget to commit another change in svn. Fixed now by commit #612869. Please checkout and confirm if all is ok now... Gilles One word: perfect ! It's fine now, thanks a lot Gilles !! You really deserves come holidays ;-) I close the bug. |