← Back to team overview

phatch-dev team mailing list archive

[Bug 514151] Re: "'NoneType' object has attribute 'bands'" on Filigranne (watermark)

 

Please attach your action list and an example photo to reproduce the
problem.

** Changed in: phatch
       Status: New => Incomplete

** Changed in: phatch
     Assignee: (unassigned) => stani (stani)

-- 
"'NoneType' object has attribute 'bands'" on Filigranne (watermark)
https://bugs.launchpad.net/bugs/514151
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Incomplete

Bug description:
Hi ! I'm using Phtach on a Debian Squeeze (testing) AMD64, with the version 0.2.5 (from rep), with Python 2.5.4 from the rep too.
I have a buq when I'm using a batch with watermark.

Here the log returned after error :

Error 0:Impossible d'appliquer l'action filigrane sur l'image 'IMG_0030.jpg' dans le dossier:
/home/owintwist/Photos/01 - Concerts/Agen/ENAP/2008 07 08 - Bombes 2 bal

'NoneType' object has no attribute 'bands'

Action:{'fields': {'Horizontal Justification': 'Right',
            'Horizontal Offset': u'-3 %',
            'Mark': u'/home/owintwist/Photos/Batch/watermark_300.png',
            'Method': u'Tile',
            'Offset': u'3 %',
            'Opacity': u'70',
            'Orientation': u'Normal',
            'Position': u'Bottom Right',
            'Vertical Justification': 'Bottom',
            'Vertical Offset': u'-3 %',
            '__enabled__': 'yes'},
 'label': 'Watermark'}

Traceback (most recent call last):
  File "/usr/share/phatch/phatch/core/api.py", line 609, in apply_action_to_photo
    photo = action.apply(photo, read_only_settings, cache)
  File "/usr/share/phatch/phatch/core/models.py", line 106, in apply
    photo.get_layer().apply_pil(self.pil, **values)
  File "/usr/share/phatch/phatch/core/pil.py", line 737, in apply_pil
    self.image = function(self.image, *arg, **keyw)
  File "/usr/share/phatch/phatch/actions/watermark.py", line 41, in watermark
    orientation, opacity)
  File "/usr/share/phatch/phatch/lib/imtools.py", line 275, in generate_layer
    mark = reduce_opacity(mark, opacity)
  File "/usr/share/phatch/phatch/lib/imtools.py", line 371, in reduce_opacity
    alpha = get_alpha(im)
  File "/usr/share/phatch/phatch/lib/imtools.py", line 508, in get_alpha
    return image.split()[-1]
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1497, in split
    if self.im.bands == 1:
AttributeError: 'NoneType' object has no attribute 'bands'
*





References