GNOME Bugzilla – Bug 539348
f-spot cannot import photos from a folder with double quotes in its name
Last modified: 2008-06-23 14:27:50 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,
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]
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 '
the correct fix for this is probably to use DbCommand, which _should_ escape the strings properly.
Created attachment 113243 [details] [review] proposed fix maxxer. that's what I meant by using DbCommand
fixed in r4082