photo.close(): AttributeError: 'NoneType' object has no attribute 'close'

Bug #566141 reported by Piotr Krukowiecki
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Confirmed
High
Stani

Bug Description

I'm unsing ppa karmic phatch (0.2.7) to batch rename/move files (Rename action)

I've put <Exif_Image_DateTime.year> in the second (target) Rename parameter and run the action.

There's an error:
   Unable to open file: /.../zima.jpg:
   Unable extract variables from file: /.../zima.jpg:
   Tag not set

When I press "Skip To Next Image" phatch just hangs with "Executing action list" dialogue open, but nothing happens, no In/File is displayed, "Remaining time" is "unknown".

There's a python error displayed in console:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/phatch/pyWx/gui.py", line 701, in on_menu_tools_execute
    self._execute(actionlist)
  File "/usr/lib/python2.6/dist-packages/phatch/pyWx/gui.py", line 300, in _execute
    update=self._send_update_event, **keyw)
  File "/usr/lib/python2.6/dist-packages/phatch/core/api.py", line 729, in apply_actions_to_photos
    is_done, image_index, repeat)
  File "/usr/lib/python2.6/dist-packages/phatch/core/api.py", line 780, in apply_actions_to_photo
    photo.close()
AttributeError: 'NoneType' object has no attribute 'close'

Also, pressing "Cancel" on the hanged "Executing action list" window does not help - does not stop/close the execution. I have to press the "X" to close the window.

Image Inspector shows that there are no exif tags in the zima.jpg image.

I have "Stop for errors" checkbox checked. If I uncheck it there's no dialogue, but it seems phatch tries to rename all images, but it still hangs. And even if some other image has required tag it's not renamed.

Revision history for this message
Piotr Krukowiecki (piotr-krukowiecki-news) wrote :

Looks like this has been fixed in trunk about a month ago...

Revision history for this message
Stani (stani) wrote :

You can not edit/set attributes of an exif value. You can recognize attributes as they have dots in their names. Also in the image inspector they won't have a pencil icon. If you want to This is not a bug but a limitation of the current system. In your case you need to define a new value for Exif_Image_DateTime as a whole. I can look up the syntax if you want. If you want to be able to set attributes, you need to file a blueprint (=feature request).
However the AttributeError is a real bug which we need to fix.

Changed in phatch:
assignee: nobody → Stani (stani)
summary: - Hang with 'Tag not set' error when exif tag does not exists in an image
+ photo.close(): AttributeError: 'NoneType' object has no attribute
+ 'close'
Changed in phatch:
importance: Undecided → High
milestone: none → 0.2.8
status: New → Confirmed
Revision history for this message
Piotr Krukowiecki (piotr-krukowiecki-news) wrote :

Hi,

I'm not sure if I understand your comment. Is it really for this bug?
AFAIK the problem I've reported is already fixed in trunk and the fix was to check if photo was not None before closing it...

I'd close this bug yesterday, but I was under impression I have no such powers.

Revision history for this message
GOlaf (olaf-ripegard) wrote :

I have the same problem. Running Phatch on Windows 7.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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