← Back to team overview

phatch-dev team mailing list archive

[Bug 526489] Re: [Test] cannot identify image file

 

$ bzr diff
=== modified file 'phatch/lib/imtools.py'
--- phatch/lib/imtools.py	2010-02-28 17:36:29 +0000
+++ phatch/lib/imtools.py	2010-02-28 18:49:22 +0000
@@ -905,8 +905,12 @@
     #save image with pil
     save(image, filename, **options)
     #verify saved file
-    image_file = Image.open(filename)
-    image_file.verify()
+    try:
+        image_file = Image.open(filename)
+        image_file.verify()
+    except IOError:
+        # We can't verify the image mode with PIL, so issue no warnings.
+        return ''
     if image.mode != image_file.mode:
         return image_file.mode
     return ''


** Changed in: phatch
       Status: In Progress => Fix Committed

-- 
[Test] cannot identify image file
https://bugs.launchpad.net/bugs/526489
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Fix Committed

Bug description:
actionlist: /home/stani/sync/python/phatch/repo/test/tests/output/actionlists/convert_mode_save_Mode=1_As=im.phatch
Error 0:Can not apply action Save on image 'exif.jpg' in folder:
/home/stani/sync/python/phatch/repo/test/tests/input

cannot identify image file

Action:{'fields': {'As': u'im',
            'File Name': u'<filename>_convert_mode_save_Mode=1_As=im',
            'In': u'/home/stani/sync/python/phatch/repo/test/tests/output/images',
            'JPEG Quality': u'85',
            'JPEG Size Maximum': '0kb',
            'JPEG Size Tolerance': '5%',
            'Metadata': 'yes',
            'PNG Optimize': 'yes',
            'Resolution': u'<dpi>',
            'Show Type Options': 'no',
            'TIFF Compression': u'<compression>',
            '__enabled__': 'yes'},
 'label': 'Save'}

Traceback (most recent call last):
  File "/home/stani/sync/python/phatch/repo/test/phatch/core/api.py", line 609, in apply_action_to_photo
    photo = action.apply(photo, read_only_settings, cache)
  File "/home/stani/sync/python/phatch/repo/test/phatch/actions/save.py", line 159, in apply
    save_metadata=save_metadata, **options)
  File "/home/stani/sync/python/phatch/repo/test/phatch/core/pil.py", line 594, in save
    raise IOError(message)
IOError: cannot identify image file





References