Drag and drop multiple images from F-Spot fails

Bug #382766 reported by Droopy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
High
Stani

Bug Description

When I drag and drop several images from F-Spot, I can't process the batch.
If I use only one image, it works fine

Tested on OpenSuse 11 - phatch 0.1.6

Revision history for this message
Stani (stani) wrote :

Thanks for reporting this bug.

Changed in phatch:
assignee: nobody → stani (stani)
importance: Undecided → High
status: New → Confirmed
summary: - Multiple Image and F-Spot
+ Drag and drop multiple images from F-Spot fails
Revision history for this message
Stani (stani) wrote :

@Droopy
It was very easy to fix. The fix is in the bazaar repository (bzr branch lp:phatch) and will be part of the next release. Please keep on filing bugs but of course check first if it has not been reported earlier.

$ bzr diff
=== modified file 'phatch/pyWx/lib/droplet.py'
--- phatch/pyWx/lib/droplet.py 2009-05-21 03:04:27 +0000
+++ phatch/pyWx/lib/droplet.py 2009-06-02 14:30:45 +0000
@@ -15,17 +15,29 @@

 #standard modules
 import os
+import types

 #gui-dependent
 import wx

+def fix_paths(paths):
+ if isinstance(paths,(types.ListType,types.TupleType)) \
+ and len(paths) == 1:
+ paths = paths[0]
+ if isinstance(paths,types.StringTypes):
+ paths = paths.strip().split('\n')
+ for index, path in enumerate(paths):
+ if path.startswith('file://'):
+ paths[index] = path[7:]
+ return paths
+
 class FileDropTarget(wx.FileDropTarget):
     def __init__(self, method):
         super(FileDropTarget,self).__init__()
         self.method = method

     def OnDropFiles(self, x, y, filenames):
- self.method(filenames,x,y)
+ self.method(fix_paths(filenames),x,y)

 class Mixin:
     def SetAsFileDropTarget(self,object,method):

stani@blue:~/sync/python/phatch/trunk/phatch$ bzr commit -m "fix drag and drop from f-spot"
Committing to: /home/stani/sync/python/phatch/trunk/
modified phatch/pyWx/lib/droplet.py
Committed revision 624.

Changed in phatch:
status: Confirmed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Droopy (serge-tellier) wrote :

I have tested the patch, but I received always the message:

Sorry, "/home/serge/Photos/2009/06/01/img_4777.jpg
file:/home/serge/Photos/2009/06/01/img_4781.jpg" is not a valid path.

From Nautilus it works fine.

Serge

Revision history for this message
Droopy (serge-tellier) wrote :

Ok it works, I don't remove one line in your code ;-)

- self.method(filenames,x,y)

Tx

Serge

Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.