GNOME Bugzilla – Bug 509792
Commas need special treatment in tag names
Last modified: 2018-07-01 09:04:23 UTC
It is possible to create and use tags containing commas, but using the tag editor (the one that appears when you press "t" on a photo) on photos tagged with these names leads to an annoying behaviour: 1. Create a tag named "cretins, bastards, idiots, etc." 2. Add this tag to a photo of your choice. 3. View this photo and type "T" to open the tag editor. 4. Edit the tags, e.g., add "Hidden", and press Enter. 5. Find new tags in your tag view: "cretins", "bastards", "idiots" and "etc." are separate tags now. This is of course just based on the fact that "," is used as a field separator in the tag editor and is thus absolutely logical, but one should be aware of this when using commas in tag names. I know someone who accidently messed up his tag tree quite a bit this way. F-Spot could easily forbid commas on tag creation, but then, what should it do when importing already tagged images with tags containing commas? Or, if commas are valid in tag names, maybe the tag editor should display them with an escape character like "\," and interpret them the same way? To be able to use "\" in tag names, that would have to be converted to "\\", respectively. Maxxer commented via mailinglist that using backslashes would be really bad for users and suggested enclosing tags containing commas in double quotes. That's OK if only tags containing commas are enclosed in double quotes, since forcing the user to enclose every tag in "" would be annoying. But how should double quotes in tag names be handled then? Just forbidding double quotes in tag names would bring up the same problems as forbidding commas would do. Using \" would bring up the same usability issue mentioned above. Using "" would be a bit delusive (imagine a tag printed as '"this ""is a"" tag"'), but that's what is used in CSV files which by their nature share the same problem I'm describing here. In fact, both mentioned posibilities are widely used in CVS files, but the latter one made it into RFC 4180, so maybe we should also stick to that solution. See section 2, item 7 for reference: http://tools.ietf.org/html/rfc4180#section-2 So, to make a long story short, I would propose the following small changes to the tag editor: 1. On displaying, if a tag name contains commas, it is enclosed in double quotes. 2. On displaying, if a tag name contains double quotes, double them. 3. On saving, if a sole double quote is encountered, read everything until the next sole double quote or end of string as a single tag. 4. On saving, convert doubled double quotes to single ones. A simpler alternative would be to forget the double quotes and just use doubled commas to express a literal comma in the tag editor. "My tiny, shiny tag" would just become "My tiny,, shiny tag" that way, and the proposal would shrink to these points: 1. On displaying, if a tag name contains commas, double them. 2. On saving, split on single commas, not doubled commas. 3. On saving, convert doubled commas to single ones. This being simpler to code and to use as well, I want to vote for this solution. It would just have to be documented, but that would be true for any solution. If the developer team is OK with this, I think I can provide a patch.
*** Bug 565653 has been marked as a duplicate of this bug. ***
f-spot is not under active development anymore, has not seen code changes for five years, and saw its last tarball release in the year 2010. Its codebase has been archived: https://gitlab.gnome.org/Archive/f-spot/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.