After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 592835 - Captions may be mixed up after uploading to Facebook
Captions may be mixed up after uploading to Facebook
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Export
0.6.x
Other Linux
: Normal normal
: 0.6.0
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-23 23:15 UTC by Andy Brown
Modified: 2009-08-25 07:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Move FacebookExport photo sorting before captions are applied (2.91 KB, patch)
2009-08-24 22:15 UTC, Andy Brown
none Details | Review

Description Andy Brown 2009-08-23 23:15:27 UTC
After uploading to Facebook, a user may find his captions have been applied to the wrong photos.

In looking at the source code, basically there are four factors:
  - Captions are stored separately from the photos
  - Photos are sorted by date after captions have been set
  - F-Spot normally shows newest photos first
  - Order of selection may be arbitrary?

In more detail, currently the user enters captions for each photo in the "Export to Facebook" dialog as normal.  The extension saves the captions into an array of strings, appropriately named "captions".

Obviously, after clicking the "Add" button, the user expects the captions he entered in F-Spot will be the same ones he sees in Facebook, and that they will be applied to the correct photos.  However, the "Upload" method in the "FacebookExport" class sorts the photos by ascending date before it submits the photos, but makes no attempts at keeping the captions synchronized with them.  If the photos were not in ascending order already, the captions will no longer be associated with the correct photos.

The easiest fix that maintains the functionality seems to be moving the sorting code to the "FacebookExportDialog" class.  Both the "Array.Sort" line and the "DateComparer" class should be moved:

    private class DateComparer : IComparer {
        public int Compare (object left,
                            object right)
        {
            return DateTime.Compare ((left as IBrowsableItem).Time,
                (right as IBrowsableItem).Time);
        }
    }

    FacebookExportDialog (IBrowsableCollection selection) :
        base (Assembly.GetExecutingAssembly(),
	    "FacebookExport.ui",
	    "facebook_export_dialog")
    {
        items = selection.Items;
        Array.Sort (items, new DateComparer ());


A possible problem with this approach is that the user will (probably) see the photos in a different order than they were selected.  For that reason, alternatively a map could be used to associate the captions with the photos, but that would require more significant changes, and I'm not sure if it's worth it, at least for now.

I will make a patch against the Git repository after I test it out a bit more.
Comment 1 Andy Brown 2009-08-24 22:15:02 UTC
Created attachment 141599 [details] [review]
Move FacebookExport photo sorting before captions are applied

Today I built F-Spot from Git and "confirmed" this behavior still occurs.  Here is a small patch for it.
Comment 2 Maxxer 2009-08-25 07:02:05 UTC
thanks!

commit 68c4f6e3a71007ce205d7c04797d44d57823c2a2
Author: Andy Brown <adb1413@rit.edu>
Date:   Tue Aug 25 08:36:31 2009 +0200

    Ensure proper sorting in Facebook Export
    
    Closes bgo#592835.