GNOME Bugzilla – Bug 356718
Sorting images by comment
Last modified: 2006-11-07 12:58:34 UTC
I added a menu item to sort images by image comment, very useful if the comment field is used for classification of pictures. Patch attached, please review / include.
Created attachment 73032 [details] [review] Patch for gthumb 2.6.9 to include comment sorting of images
*** Bug 336978 has been marked as a duplicate of this bug. ***
This doesn't patch cleanly against CVS HEAD. Can you update your patch, and I'll take another look at committing it? - Mike
I rewrote the patch against CVS HEAD. Unfortunately HEAD doesn't compile on my system, so I have to hope I made no errors.
Created attachment 75827 [details] [review] Patch for gthumb CVS to include comment sorting of images
I'll take a look at it. What compilation problems are you having? - Mike
David, Your last patch doesn't apply to CVS HEAD. I guess a lot has changed since 2.6.9. For instance, the typedefs are totally different now: typedef enum { /*< skip >*/ GTH_SORT_METHOD_NONE, GTH_SORT_METHOD_BY_NAME, GTH_SORT_METHOD_BY_PATH, GTH_SORT_METHOD_BY_SIZE, GTH_SORT_METHOD_BY_TIME, GTH_SORT_METHOD_MANUAL } GthSortMethod; Also, you'll need to modify data/gthumb.schemas.in. - Mike
Created attachment 75916 [details] [review] Patch for gnome gthumb CVS to include comment sorting of images Sorry, I checked out the 4 year old SF CVS HEAD last time. This should be better.
Ah, that's better! Two comments: 1) I think the comment comparison code should use g_utf8_casefold + g_utf8_collate (instead of just strcmp), to allow case-insensitivity and unicode handling. See http://developer.gnome.org/doc/API/2.0/glib/glib-Unicode-Manipulation.html#g-utf8-casefold. 2) Please update data/gthumb.schemas.in to reflect the new option for /apps/gthumb/browser/arrange_images. - Mike
Created attachment 76115 [details] [review] Comment sorting patch, v2. This patch corrects a number of errors in the earlier version. It requires further testing. Please test against CVS head. - Mike
I've committed a patch with further corrections. Please test the sort-by-comment feature when viewing as a list, viewing as slides, exporting to a web album, and generating an index image. Use CVS HEAD. - Mike