[Digikam-devel] [Bug 138540] New: Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] New: Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Fabien-5
------- 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=138540         
           Summary: Pictures files are updated (but not modified) when
                    setting new metadatas albeit they are unset
           Product: digikam
           Version: 0.9.0-svn
          Platform: Ubuntu Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Metadata
        AssignedTo: digikam-devel kde org
        ReportedBy: fabien.ubuntu gmail com


Version:           0.9.0-svn (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

When digikam is configured to not save any metadata, it still call exiv2 to write metadata to file.
Note: as expected, it doesn't put new comment, tag, rating into the file, it just rewrite the file, without modifying it.

1) digikam configuration
[Metadata Settings]
IPTC Author=
IPTC Author Title=
IPTC Copyright=
IPTC Credit=
IPTC Source=
Save Date Time=false
Save EXIF Comments=false
Save IPTC Credits=false
Save IPTC Photographer ID=false
Save IPTC Rating=false
Save IPTC Tags=false


2) example
if I modify a comment (or tags, rating) on a picture, its file has a new date. File is still the same (same md5sum).

3) how to check that exiv2 is called for that

I have an album directory with that (note that the directory is not writable):
$ ls -la
total 3079
dr-x------  2 fabien fabien     112 2006-12-08 16:05 .
drwxr-xr-x 14 fabien fabien     408 2006-12-08 16:06 ..
-rw-r--r--  1 fabien fabien 1642429 2006-12-08 16:05 img_3402.jpg
-rw-r--r--  1 fabien fabien 1506637 2006-12-07 19:39 img_3403.jpg

When a change the comment, this is what I have :
digikam: Cannot save metadata using Exiv2 (/localhome/fabien/Pictures/test04/img_3402.jpg: Failed to open file (w+b): Permission denied (13))

Why Exiv2 returns an error although file is read/write ?
Because it first writes a temporary file (if size > 1MB), then remove the old one and rename the created file to the original name.

Why trying to save metadata (digikam is configured to not save metadata to image file) ?
Well, I guess that's the bug :)

This behavior applies to album gui and image editor.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Gilles Caulier-2
------- 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=138540         




------- Additional Comments From caulier.gilles kdemail net  2006-12-12 15:14 -------
>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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Gilles Caulier-2
In reply to this post by Fabien-5
------- 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=138540         
caulier.gilles kdemail net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles kdemail net  2006-12-12 15:22 -------
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):
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Gilles Caulier-2
In reply to this post by Fabien-5
------- 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=138540         




------- Additional Comments From caulier.gilles kdemail net  2006-12-12 15:39 -------
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
     {
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Fabien-5
In reply to this post by Fabien-5
------- 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=138540         
fabien.ubuntu gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |



------- Additional Comments From fabien.ubuntu gmail com  2006-12-12 18:59 -------
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 ;-)
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Gilles Caulier-2
In reply to this post by Fabien-5
------- 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=138540         




------- Additional Comments From caulier.gilles kdemail net  2006-12-12 22:20 -------
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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Fabien-5
In reply to this post by Fabien-5
------- 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=138540         
fabien.ubuntu gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME



------- Additional Comments From fabien.ubuntu gmail com  2006-12-13 15:04 -------
One word: perfect !

It's fine now, thanks a lot Gilles !!
You really deserves come holidays ;-)

I close the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel