GNOME Bugzilla – Bug 594788
Adding option for user-defined date format for renaming files
Last modified: 2010-01-18 14:53:31 UTC
There is fixed date format for renaming in GThumb. In rename dialog window we can fill %d symbol for inserting date of picture in format YYYY-MM-DD--HH.mm.ss. But there isn't option for specifying formats like (for example without time): YYYY_MM_DD. From my point of view solution of this problem/constraint can be implemented in three ways. 1. Add option to Preferences dialog for inserting user-defined format of %d symbol 2. Dividing symbol %d to symbols %Y, %M, %D, %H, %m, %S in rename dialog. 3. Both of previous: %d - user-defined + other symbols Thanks very much. Renaming is last reason, why I have to use XnView in wine. In XnView is renaming almost perfect.
Created attachment 151233 [details] [review] adding %date{} in rename function Hi Vladimir, I agree with the concept of your report. However please note that the new 2.11.x serie is a complete rewrite. %d does not exist anymore. We've been discussing with Paolo about this on the mailing list (http://live.gnome.org/gthumb) A %date{<strftime format>} is proposed. I'm providing a patch. All, please give me your feedback. It's a first draft. Probably there's some stripping to do to remove weird input characters. Matthias
Created attachment 151242 [details] [review] add help to ui Here's a patch to add the help to the ui
Created attachment 151246 [details] [review] better format help Sorry my previous patch for ui was done too quickly. Here's a new one with better format for the ui.
This bug status should be change to new
We don't really worry about NEW versus UNCONFIRMED. But I'll change it anyway :-) - Mike
Well you should ! ;-) More seriously it's nice to make the distinction, but of course it's a detail. Thanks !
Review of attachment 151233 [details] [review]: some comments on the patch: 1) %date seems ambiguous to me, I'd suggest to add %D for digitalization time and %M for modification time 2) there should be a default date format if no format is specified, for example %Y-%m-%d
Thanks for the comments Paolo. I'll update the code accordingly. However I need some help regarding digitalization time. I don't seem to get any when calling gth_file_data_get_digitalization_time even though my pictures have exif (I can see the exif in the properties panel) gth_file_data_get_digitalization_time takes a GthFileData must it somehow be initialized for the metadata ?
this is because in gth_browser_activate_action_edit_rename() instead of simply getting the file_data from the list we need to call _g_query_all_metadata_async to get the file_data list.
Ok, I see, but I'm not very confident on how to implement this, with the callback and all.
Created attachment 151384 [details] [review] 2 dates code Here's a new patch: date changes from %date{} to %M and %D Both can take format input in {}, but have a default '%Y-%m-%d' format if none is provided. The behavior is quite nice, have a try ! UI help is updated too. Now I still need a correct call in gth_browser_activate_action_edit_rename() to get the metadata. Help appreciated :-) Matthias
patches applied (thanks) + some changes: *) added code to read all the metadata to make %D works correctly *) renamed %attr as %A *) unified the %D and %M code *) changed the help strings
Cool. Closing...