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 539348 - f-spot cannot import photos from a folder with double quotes in its name
f-spot cannot import photos from a folder with double quotes in its name
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Import
0.4.x
Other Linux
: Normal normal
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-20 18:46 UTC by Pedro Villavicencio
Modified: 2008-06-23 14:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
allow-quotes-into-dir-names-on-import.patch (1.58 KB, patch)
2008-06-21 14:19 UTC, Maxxer
needs-work Details | Review
proposed fix (1.23 KB, patch)
2008-06-23 08:19 UTC, Stephane Delcroix
committed Details | Review

Description Pedro Villavicencio 2008-06-20 18:46:51 UTC
this report has been filed here:

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

"f-spot 0.4.3.1

Steps:
1- Rename a photo folder to contain double quotes
2- Open f-spot
3- Select "Import"
4- Select the above folder from the file open menu under "chose folder"

Expected:
Photos in the folder are displayed in the import preview

Actual result:
No photos are displayed, so nothing can be imported.

Attached:
Screen shot of the same folder with quotes in the folder name, and renamed to not contain any quotes in the path."

http://launchpadlibrarian.net/15454374/Bildschirmfoto-Importieren.png
http://launchpadlibrarian.net/15454383/Bildschirmfoto-Importieren-1.png

Thanks,
Comment 1 Maxxer 2008-06-21 06:28:53 UTC
seems f-spot fails to execute the query to detect dupes: no escape of quotes.

Scanning /home/maxxer/Scrivania/Gallery/Prova "aaa"
[Debug 08:08:27.310] Query: SELECT photos.id, photos.time, photos.uri, photos.description, photos.roll_id, photos.default_version_id, photos.rating FROM photos WHERE uri LIKE "file:///home/maxxer/Scrivania/Gallery/Prova "aaa"%" AND uri NOT LIKE "file:///home/maxxer/Scrivania/Gallery/Prova "aaa"/%/%"
Mono.Data.SqliteClient.SqliteSyntaxException: near "aaa": syntax error
  at Mono.Data.SqliteClient.SqliteCommand.GetNextStatement (IntPtr pzStart, System.IntPtr& pzTail, System.IntPtr& pStmt) [0x00000] 
  at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000] 
  at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior) [0x00000] 
  at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader () [0x00000] 
  at (wrapper remoting-invoke-with-check) Mono.Data.SqliteClient.SqliteCommand:ExecuteReader ()
  at Banshee.Database.QueuedSqliteCommand.Execute () [0x00000] 
Comment 2 Maxxer 2008-06-21 14:19:31 UTC
Created attachment 113164 [details] [review]
allow-quotes-into-dir-names-on-import.patch

enclosing dir name into single quotes (no need to escape "), added escape for '
Comment 3 Stephane Delcroix 2008-06-22 18:52:25 UTC
the correct fix for this is probably to use DbCommand, which _should_ escape the strings properly.
Comment 4 Stephane Delcroix 2008-06-23 08:19:23 UTC
Created attachment 113243 [details] [review]
proposed fix

maxxer. that's what I meant by using DbCommand
Comment 5 Stephane Delcroix 2008-06-23 14:27:50 UTC
fixed in r4082