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 327068 - "Copy Photo Location" should put quotes around space-containing filenames
"Copy Photo Location" should put quotes around space-containing filenames
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: General
CVS
Other All
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
: 620749 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-01-15 13:54 UTC by Robin Munn
Modified: 2018-07-12 00:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Robin Munn 2006-01-15 13:54:31 UTC
I have photos in several folders, including one called "f-spot import test".
This makes life interesting when I try to do anything on the bash prompt with
them. For example, here's what happens when I select four photos from two
different locations, use "Copy Photo Location" to get their filenames, and then
try to paste the result into a bash prompt command:

rmunn@localhost:~$ ls /home/rmunn/Photos/2006/1/14/DSCN4164.jpg
/home/rmunn/Photos/2006/1/14/DSCN4163.jpg /home/rmunn/f-spot import
test/foo/img_3476.jpg /home/rmunn/f-spot import test/foo/img_3475.jpg
ls: /home/rmunn/f-spot: No such file or directory
ls: import: No such file or directory
ls: test/foo/img_3476.jpg: No such file or directory
ls: /home/rmunn/f-spot: No such file or directory
ls: import: No such file or directory
ls: test/foo/img_3475.jpg: No such file or directory
/home/rmunn/Photos/2006/1/14/DSCN4163.jpg  /home/rmunn/Photos/2006/1/14/DSCN4164.jpg

If the list of filenames is to be useable, it should probably have quotes around
any filenames that contain spaces or other special characters. In the above
example, it would have been easy enough to add the quotes myself, but doing so
for 200+ photos at a time would quickly get tedious.

Thanks!
Comment 1 Gabriel Burt 2006-01-24 06:25:37 UTC
I have a simple patch that escapes any special characters, and produces this for a photo in folder "test ing this":

/home/gabe/Desktop/Photos/test%20ing%20this/pict0027.jpg

The one-liner is this:

Gnome.Vfs.Escape.PathString (System.IO.Path.GetFullPath (p.DefaultVersionPath))

Is this going to cause any problems with anything?  Is there some spec we are following when we put the URIs in the clipboard?
Comment 2 Larry Ewing 2006-01-25 16:30:28 UTC
http://www.rfc-archive.org/getrfc.php?rfc=2483 section 5 is about as close as you get I think.  The main thing is, does this actually fix the problem if the uri is pasted to say a gnome-terminal?  It does its own unescaping
Comment 3 Gabriel Burt 2006-01-25 22:41:05 UTC
When I do 'Copy Photo Location' and paste it into gnome-terminal, it does not escape it for me (eg the spaces in the path still show up).

Would quotation marks be the way to go here?  It doesn't seem so to me.  From reading the RFC's, it sounds like if we're calling the paths URIs, then we should escape them.
Comment 4 Bengt Thuree 2007-11-26 17:05:21 UTC
Also very related to bug #443862
Comment 5 Clarence Risher 2010-04-07 17:20:53 UTC
This trivial patch adds quoting, which has fixed the problems with using f-spot in conjunction with a terminal for me.

diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index 69cbfae..cc14c73 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -2418,3 +2418,3 @@ namespace FSpot
                        foreach (Photo p in SelectedPhotos ()) {
-                               pt.Add (System.IO.Path.GetFullPath (p.DefaultVersionUri.LocalPath));
+                               pt.Add ("\"" + System.IO.Path.GetFullPath (p.DefaultVersionUri.LocalPath) + "\"");
                        }
Comment 6 Maxxer 2010-06-06 19:10:49 UTC
*** Bug 620749 has been marked as a duplicate of this bug. ***
Comment 7 André Klapper 2018-07-12 00:03:05 UTC
F-Spot has moved to https://github.com/f-spot/f-spot/issues

If this Bugzilla ticket is still valid in a recent version of F-Spot, please feel free to post this topic as a ticket in the F-Spot project on GitHub.

Closing this report as WONTFIX as part of Bugzilla Housekeeping as we are planning to shut down GNOME Bugzilla in favor of GNOME Gitlab.