GNOME Bugzilla – Bug 719142
Assertion failure on removing photo from last import roll
Last modified: 2017-10-03 18:53:14 UTC
---- Reported by joseph.bylund+shotwell@gmail.com 2013-09-13 16:10:00 -0700 ---- Original Redmine bug id: 7487 Original URL: http://redmine.yorba.org/issues/7487 Searchable id: yorba-bug-7487 Original author: Joe Bylund Original description: I imported a single file from an sd card, then deleted the file and I got the following assertion failure, I can't immediately reproduce. ERROR:/home/jbylund/Desktop/git/shotwell/src/MediaViewTracker.vala:72:media_accumulator_real_uninclude: assertion failed: (photos > 0) ---- Additional Comments From shotwell-maint@gnome.bugs 2013-10-03 18:22:00 -0700 ---- ### History #### #1 Updated by Jim Nelson 2 months ago * **Category** set to _import_ #### #2 Updated by Jim Nelson about 1 month ago * **Target version** deleted (<strike>_0.15.0_</strike>) --- Bug imported by chaz@yorba.org 2013-11-25 21:59 UTC --- This bug was previously known as _bug_ 7487 at http://redmine.yorba.org/show_bug.cgi?id=7487 Unknown version " in product shotwell. Setting version to "!unspecified". Unknown milestone "unknown in product shotwell. Setting to default milestone for this product, "---". The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chaz@yorba.org. Previous reporter was joseph.bylund+shotwell@gmail.com. Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. Resolution set on an open status. Dropping resolution
*** Bug 723052 has been marked as a duplicate of this bug. ***
There's another report which looks somewhat similar here: https://bugzilla.redhat.com/show_bug.cgi?id=954022 It's for a much older version of the code, but does contain a backtrace.
There's also a stack trace at https://bugzilla.redhat.com/attachment.cgi?id=737797, thread #1.
*** Bug 773183 has been marked as a duplicate of this bug. ***
*** Bug 777564 has been marked as a duplicate of this bug. ***
For me, this is one of the most annoying issues. I'll try to solve it.
For documentation: I can be reproduce this by 2 ways. The pre-conditions: * RAW Developer: Camera * RAW+JPEG pair First way (the easy one): * Import 20 RAW+JPEG pairs from the camera and wait until the import is complete and the page "Last Import" is successfully loaded. * Select a random (or all) photo on the last import page (do not navigate in the tree) and delete the selected items. * Shotwell will crash (MediaViewTracker.vala:72:media_accumulator_real_uninclude: assertion failed: (photos > 0)) Second way (you need the right timing) * Import 20 RAW+JPEG pairs from the camera and wait, until the import is complete and the page "Last Import" is successfully loaded. * Navigate quickly to the event and delete all photos. * Shotwell will crash (MediaViewTracker.vala:72:media_accumulator_real_uninclude: assertion failed: (photos > 0)) The problem seems to be the RAW development in the background. The MediaAccumulator counts 0 photos but 20 RAW after the include operations. 0 photos, because photo.is_raw_developer_available(RawDeveloper.CAMERA) still returns false. When you remove the image, then, photo.is_raw_developer_available(RawDeveloper.CAMERA) returns true and the uninclude method tries to remove a photo. But assert(photos > 0) is false.
Created attachment 358792 [details] [review] The state of raw development does not affect filtering anymore. Primarily, the counter for photos, videos, and raw in MediaViewTracker affects the enabled/disabled state of the corresponding filter buttons. Solving this issue needs a short discussion about the role of the condition photo.is_raw_developer_available(RawDeveloper.CAMERA) when counting photos/raw or doing the filtering for photos/raw. From my point of view, this condition is not necessary and leads to a misleading behavior during filtering Actual behavior: An event contains a JPEG, a RAW only and a RAW+JPEG photo Filtering photos shows: JPEG and RAW+JPEG Filtering RAW shows: RAW only and RAW+JPEG What I would expect: Filtering photos should show: JPEG, RAW only and RAW+JPEG Filtering RAW should show: RAW only and RAW+JPEG The question: What’s the reason, that Shotwell doesn’t show RAW only when filtering for photos. A RAW photo is still a photo. This is, why I think that photo.is_raw_developer_available(RawDeveloper.CAMERA) is not necessary for filtering. The expected behavior is reached by the attached patch
Thanks, I will have a deeper look later. I _think_ the intention was to say "which has a development". It might be a side effect of RAW being somewhat "bolted onto" Shotwell.
Comitted with minor re-formatting of the commit message