[Bug 288761] New: cached image corrupted after modifying metadata

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

[Bug 288761] New: cached image corrupted after modifying metadata

Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761

           Summary: cached image corrupted after modifying metadata
           Product: digikam
           Version: 2.5.0
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Created an attachment (id=66641)
 --> (http://bugs.kde.org/attachment.cgi?id=66641)
corrupted image

Version:           2.5.0 (using KDE 4.7.2)
OS:                Linux

I've configured digikam to save metadata embedded in my picture files, which
are usually jpg. Now when I modify metadata, i.e. assign or modify tags or
ratings, the shown image gets updated, and often is corrupted, that is, only
part of the picture remains visible, the rest is only one gray color. The saved
file is not currupted, I guess you call it the cached image which is shown,
which is corrupted.

I assume that this is caused by reloading the cached image while the disk file
write hasn't completely finished. This happens about one out of 3 times, when
I'm modifying data. How much of the picture is corrupted varies from 0-100%,
but it's always a straight cut as shown in the attached screenshot.

This problem happens here at least with digikam 1.4, 1.7, 2.0, 2.5






Reproducible: Sometimes

Steps to Reproduce:
Assign rating by hitting Ctrl-1 or Ctrl-2, ...

It happens "easier" if you do this in a fast sequence, like press Ctrl-1 five
times in a second.


Actual Results:  
The image on the screen is partially corrupted as shown in the screenshot.

The log shows for example (the messages "slotFileRemoved, slotFileDeleted,...
were created by me):

digikam(22644)/digikam (core) Digikam::DMetadata::getImageHistory: Loading
image history  ""
digikam(22644)/digikam (core) Digikam::DMetadata::setImageTitles:
"/home/speicher/gqview/test/DSCN3798.JPG"  ==> Title:  QMap()
digikam(22644)/digikam (core) Digikam::DMetadata::setImageComments:
"/home/speicher/gqview/test/DSCN3798.JPG"  ==> Comment:  QMap()
digikam(22644)/digikam (core) Digikam::DMetadata::setImageRating:
"/home/speicher/gqview/test/DSCN3798.JPG"  ==> Rating:  3
slotFileClosedAfterWrite:  "/home/speicher/gqview/test/DSCN3798.JPG22644"

digikam(22644)/digikam (core) Digikam::AlbumWatch::rescanDirectory: Detected
change, triggering rescan of directory "/home/speicher/gqview/test"
slotFileClosedAfterWrite:  "/home/speicher/gqview/test/DSCN3798.JPG"

digikam(22644)/digikam (core) Digikam::AlbumWatch::rescanDirectory: Detected
change, triggering rescan of directory "/home/speicher/gqview/test"
slotFileDeleted:  "/home/speicher/gqview/test/DSCN3798.JPG"

digikam(22644)/digikam (core) Digikam::AlbumWatch::rescanDirectory: Detected
change, triggering rescan of directory "/home/speicher/gqview/test"
slotFileMoved:  "/home/speicher/gqview/test/DSCN3798.JPG22644"

digikam(22644)/digikam (core) Digikam::AlbumWatch::rescanDirectory: Detected
change, triggering rescan of directory "/home/speicher/gqview/test"
slotFileMoved:  "/home/speicher/gqview/test/DSCN3798.JPG"

digikam(22644)/digikam (core) Digikam::AlbumWatch::rescanDirectory: Detected
change, triggering rescan of directory "/home/speicher/gqview/test"
digikam(22644)/digikam (core) Digikam::DImg::load:
"/home/speicher/gqview/test/DSCN3798.JPG"  : JPEG file identified
digikam(22644)/digikam (core)
Digikam::ScanControllerLoadingCacheFileWatch::slotImageChanged: 27689
"/home/speicher/gqview/test/DSCN3798.JPG"



Expected Results:  
image remains intact

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 288761] cached image corrupted after modifying metadata

Gilles Caulier-4
https://bugs.kde.org/show_bug.cgi?id=288761


Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
          Component|general                     |Metadata




--- Comment #1 from Gilles Caulier <caulier gilles gmail com>  2011-12-12 18:27:56 ---
Can you provide a copy of JPEG image before and after corruption ?

Gilles Caulier

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 288761] cached image corrupted after modifying metadata

Bugzilla from kde@schreiber-rolf.de
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761





--- Comment #2 from  <kde schreiber-rolf de>  2011-12-12 18:56:17 ---
The file itself is NOT corrupted, it's just the image displayed which is
corrupted. Pressing Ctrl-1 again usually fixes the displayed image.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 288761] cached image corrupted after modifying metadata

Bugzilla from kde@schreiber-rolf.de
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761





--- Comment #3 from  <kde schreiber-rolf de>  2011-12-16 18:02:18 ---
I think I've debugged down now, what the problem is:

If a second modification of a file happens in short time distance to the first
modification, then while loading the preview image because of the first
modification (previewtask.cpp PreviewLoadingTask::execute(), line
m_img.load(m_loadingDescription.filePath, this,
m_loadingDescription.rawDecodingSettings);

at the same time because of the second modification another thread writes
file.jpg$pid, removes file.jpg and moves file.jpg$pid to file.jpg

at the momement of the file remove the previewload thinks loading has finished,
while in reality only a part of the image has been read, and thats the part
which is displayed then.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 288761] cached image corrupted after modifying metadata

Marcel Wiesweg
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761





--- Comment #4 from Marcel Wiesweg <marcel wiesweg gmx de>  2011-12-25 14:25:49 ---
I see the problem. The loading cache's file watch is still based on KDirWatch
and needs to be rebased on AlbumWatch/inotify.
I think the solution will create a simplistic LoadingCacheFileWatch which keeps
a list and uses the information becoming available in AlbumWatch. I will ping
you to test again then.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 288761] cached image corrupted after modifying metadata

Marcel Wiesweg
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761

--- Comment #5 from Marcel Wiesweg <[hidden email]> ---
With recent versions, we have (in-process) read/write locks which will prevent
reading while another thread writes. Testing and confirmation is welcome.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 288761] cached image corrupted after modifying metadata

Gilles Caulier-4
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761

--- Comment #6 from Gilles Caulier <[hidden email]> ---
To [hidden email],

Do you see previous message from Marcel ?

Can you test with digiKam 3.x serrie to see if problem still reproducible ?

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 288761] cached image corrupted after modifying metadata

Bugzilla from kde@schreiber-rolf.de
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761

[hidden email] changed:

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

--- Comment #7 from [hidden email] ---
I can confirm, that with 3.1 I cannot reproduce this problem anymore, so I
think the fix is working.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 288761] cached image corrupted after modifying metadata

Gilles Caulier-4
In reply to this post by Bugzilla from kde@schreiber-rolf.de
https://bugs.kde.org/show_bug.cgi?id=288761

Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |4.0.0

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel