GNOME Bugzilla – Bug 592835
Captions may be mixed up after uploading to Facebook
Last modified: 2009-08-25 07:02:14 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.
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.
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.