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 559093 - f-spot can't import from directories with a : (colon) in the name
f-spot can't import from directories with a : (colon) in the name
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Import
0.5.x
Other Linux
: Normal normal
: 0.7.0
Assigned To: F-spot maintainers
F-spot maintainers
: 603028 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-03 12:22 UTC by Pedro Villavicencio
Modified: 2010-06-21 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pedro Villavicencio 2008-11-03 12:22:37 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/f-spot/+bug/289732

"f-spot 0.5.0.3

When trying to import photos from a directory with a colon in the name, the import wizard shows no photos.

Removing the colon allows the import.

It seems that the colon is not escaped in the URI as it should be.

Running in a terminal gives the following error:

System.UriFormatException: URI scheme must start with a letter and must consist of one of alphabet, digits, '+', '-' or '.' character.
  at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000]
  at System.Uri.ParseUri (UriKind kind) [0x00000]
  at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000]
  at System.Uri..ctor (System.String uriString) [0x00000]
  at FileImportBackend.GetListing (System.IO.DirectoryInfo dirinfo, System.IO.FileInfo[] files, Boolean recurse) [0x00000]
  at FileImportBackend.GetListing (System.IO.DirectoryInfo info) [0x00000]"
Comment 1 van.de.bugger 2008-12-27 00:21:08 UTC
+1.
Comment 2 Frank de Lange 2009-11-26 00:33:30 UTC
See also https://bugs.launchpad.net/ubuntu/+source/f-spot/+bug/475811

...
...
AppendValues ( Gtk.TreeIter, 2003%20Kitchen%20Before)
AppendValues ( Gtk.TreeIter, Michigan)
AppendValues ( Gtk.TreeIter, Volume%202)
AppendValues ( Gtk.TreeIter, Volume%203)
AppendValues ( Gtk.TreeIter, 2005-02-12--14:13:46)
[Warn 00:53:34.914] Caught an exception - URI scheme must start with a letter and must consist of one of alphabet, digits, '+', '-' or '.' character. (in `System')

Notice that as soon as a name with a colon in it shows up f-spot børks. A look at mcs/class/System/System/Uri.cs (part of Mono) shows what happens: as soon as there is a colon in a string and that colon is not at position 0 (which is always an error) or position 1 (which is interpreted as following an MS-DOS/Windows drive letter) the part of the string before the colon is interpreted as an URI scheme (eg http, file, ftp, etc.). This will naturally lead to an error as (in the above example) ' 2005-02-12--14' is not a valid scheme.

The solution is for f-spot to %-encode colons in the string before it gets handled by any of Mono's URI-handling functions. It does this for spaces (->%20) but not for colons (->%3A). This should be changed...
Comment 3 Ruben Vermeersch 2009-11-28 17:08:47 UTC
*** Bug 603028 has been marked as a duplicate of this bug. ***
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2009-11-29 22:00:50 UTC
I'll get the problem after an upgrade from whatver was in opensuse-11.1 when I upped to 11.2 which contains f-spot 0.6.1.3.

[Debug 23:58:02.084] open uri = file:///home/family/images/DigiCam/2009/2009-01-01 Maikatze/2009-IV Quartal W2009-10-27 Stokke-Salami/img_2357.jpg
GLib.GException: Error opening file: No such file or directory
  at GLib.FileAdapter.Read (GLib.Cancellable cancellable) [0x00000] 
  at FSpot.ImageFile.Open () [0x0001e] in /usr/src/packages/BUILD/f-spot-0.6.1.3/src/Imaging/ImageFile.cs:34 
  at FSpot.JpegFile.PixbufStream () [0x00012] in /usr/src/packages/BUILD/f-spot-0.6.1.3/src/Imaging/JpegFile.cs:62 
  at FSpot.ImageFile.Load (Int32 max_width, Int32 max_height) [0x00000] in /usr/src/packages/BUILD/f-spot-0.6.1.3/src/Imaging/ImageFile.cs:121 
  at ImageLoaderThread.ProcessRequest (.RequestItem request) [0x00018] in /usr/src/packages/BUILD/f-spot-0.6.1.3/src/ImageLoaderThread.cs:154 

The problem is in the pathname:
This is what f-spot tries
.../2009-01-01 Maikatze/2009-IV Quartal W2009-10-27 Stokke-Salami/img_2357.jpg
but the real pathname (as seen in the db file too) is:
.../2009-01-01 Maikatze/2009-IV Quartal W./2009-10-27 Stokke-Salami/img_2357.jpg
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2009-11-29 22:19:56 UTC
Okay, here is my work-around.

1.) quit f-stop
2.) rename all directories to rename the trailing dot "."
3.) cd ~/.config/f-spot
4.) sqlite3 photos.db
update photos set base_uri = replace(base_uri, "W./", "W/") where base_uri like "%W./%";
update photo_versions set base_uri = replace(base_uri, "W./", "W/") where base_uri like "%W./%";
.quit

everything should be fine now again
Comment 6 Ruben Vermeersch 2010-06-18 12:45:01 UTC
This should be fixed now, could you verify?
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2010-06-19 09:36:42 UTC
I still have F-Spot 0.6.1.5. I could recheck this when SuSe 11.3 is out and I have upgraded.
Comment 8 Ruben Vermeersch 2010-06-19 09:56:51 UTC
If you feel risky, you can try these: https://build.opensuse.org/project/show?project=GNOME%3AApps%3AF-Spot:Unstable
Comment 9 Martin Mai 2010-06-19 12:34:00 UTC
I am on Ubuntu 10.10 with f-spot 0.6.2 and when trying to import a folder with a ":" in the name, there is still the following message:


System.UriFormatException: URI scheme must start with a letter and must consist of one of alphabet, digits, '+', '-' or '.' character.
  at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] 
  at System.Uri.ParseUri (UriKind kind) [0x00000] 
  at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] 
  at System.Uri..ctor (System.String uriString) [0x00000] 
  at FileImportBackend.GetListing (System.IO.DirectoryInfo dirinfo, System.IO.FileInfo[] files, Boolean recurse) [0x00000] 
  at FileImportBackend.GetListing (System.IO.DirectoryInfo info) [0x00000]
Comment 10 Martin Mai 2010-06-19 12:36:04 UTC
Ubuntu 10.10 should soon see the update to 0.7 so I will let you know.
Comment 11 Martin Mai 2010-06-21 16:35:16 UTC
The update to 0.7 came today and it's working fine now. Thus this bug can be closed. Thanks.
Comment 12 Pedro Villavicencio 2010-06-21 18:25:45 UTC
Marking it as Fixed.