Integer error with shadow effect

Bug #219558 reported by Laurent Dufrechou
2
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
Low
Stani
phatch (Ubuntu)
Fix Released
Undecided
Stani

Bug Description

Trying to apply a shadow effect on my picture make this error:

Error 0: Impossible d'appliquer l'action Ombre sur l'image 'marport_A1_Analyst.bmp' dans le dossier:
C:\Users\ldufrechou\Desktop

an integer is required

Action: {'fields': {'Background Colour': '#FFFFFF',
            'Border': '4%',
            'Force Background Colour': u'true',
            'Horizontal Offset': '2%',
            'Shadow Blur': u'3',
            'Shadow Colour': '#444444',
            'Vertical Offset': '2%',
            '__enabled__': u'true'},
 'label': 'Shadow'}

Traceback (most recent call last):
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\api.py", line 277, in apply_action
    photo = action.apply(photo,setting,cache)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\models.py", line 59, in apply
    photo = photo.apply_pil(self.pil,**values)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 377, in apply_pil
    self.get_layer().apply_pil(function,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 399, in apply_pil
    self.image = function(self.image,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\actions\shadow.py", line 74, in drop_shadow
    image_mask = Image.new(mode,size,shadow_colour)
  File "C:\Python25\lib\site-packages\PIL\Image.py", line 1710, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required

Related branches

Revision history for this message
Stani (stani) wrote :

Please attach your full actionlist (*.phatch) and the image file 'marport_A1_Analyst.bmp'. If you prefer you can send it me privately by email at spe.stani.be (gmail). Is this a grayscale image?

Changed in phatch:
assignee: nobody → stani
status: New → Incomplete
Revision history for this message
Stani (stani) wrote :

Does it also happen with other type of images such as jpeg?

Revision history for this message
Laurent Dufrechou (laurent-dufrechou) wrote : RE: [Bug 219558] Re: Integer error with shadow effect (vista)

Hum that's strange.
Same image converted to .jpg, the lot processing run, but I can't find result!
If I look at log there is nothing.
Do I miss something? Where are saved result pics?

-----Message d'origine-----
De : <email address hidden> [mailto:<email address hidden>] De la part de stani
Envoyé : samedi 19 avril 2008 19:30
À : <email address hidden>
Objet : [Bug 219558] Re: Integer error with shadow effect (vista)

Does it also happen with other type of images such as jpeg?

--
Integer error with shadow effect (vista)
https://bugs.launchpad.net/bugs/219558
You received this bug notification because you are a direct subscriber
of the bug.

Status in Phatch = Photo & Batch!: Incomplete

Bug description:
Trying to apply a shadow effect on my picture make this error:

Error 0: Impossible d'appliquer l'action Ombre sur l'image 'marport_A1_Analyst.bmp' dans le dossier:
C:\Users\ldufrechou\Desktop

an integer is required

Action: {'fields': {'Background Colour': '#FFFFFF',
            'Border': '4%',
            'Force Background Colour': u'true',
            'Horizontal Offset': '2%',
            'Shadow Blur': u'3',
            'Shadow Colour': '#444444',
            'Vertical Offset': '2%',
            '__enabled__': u'true'},
 'label': 'Shadow'}

Traceback (most recent call last):
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\api.py", line 277, in apply_action
    photo = action.apply(photo,setting,cache)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\models.py", line 59, in apply
    photo = photo.apply_pil(self.pil,**values)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 377, in apply_pil
    self.get_layer().apply_pil(function,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 399, in apply_pil
    self.image = function(self.image,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\actions\shadow.py", line 74, in drop_shadow
    image_mask = Image.new(mode,size,shadow_colour)
  File "C:\Python25\lib\site-packages\PIL\Image.py", line 1710, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required

Revision history for this message
Stani (stani) wrote : Re: Integer error with shadow effect (vista)

Ok, I can reproduce it. So I will try to fix it.

Changed in phatch:
importance: Undecided → High
status: Incomplete → Confirmed
assignee: nobody → stani
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

motu-release ack for upload based on IRC conversation with stani.

Revision history for this message
Stani (stani) wrote :

OK, fixed in bazaar:
$ bzr commit -m "fix: shadow bug for not rgb(a) images"
modified phatch/actions/shadow.py
Committed revision 512.

You can test the code with:
bzr lp: phatch

This fix will be included in the next version of phatch 0.1.4, which will is scheduled for the 26th of april.

I'll prepare a debdiff immediately for Ubuntu Hardy in the hope it can still be included.

Revision history for this message
Stani (stani) wrote :

BTW: You can prevent this bug by converting your image to rgb first with the convert action.

Changed in phatch:
importance: High → Low
Revision history for this message
Stani (stani) wrote :

This is a debdiff for Hardy. I got an ack from ScottK on #ubuntu-motu:
(00:48:09) ScottK: In any case you have a motu-release ack for an upload, so any MOTU can sponsor the fix.

Can someone please sponsor/upload it?

Stani (stani)
Changed in phatch:
status: Confirmed → Fix Committed
status: Confirmed → In Progress
Revision history for this message
Stani (stani) wrote :

Thanks crimson for uploading the debdiff to Hardy! Now it is waiting in the unapproved queue:
https://edge.launchpad.net/ubuntu/hardy/+queue?queue_state=1&queue_text=phatch

Revision history for this message
Laurent Dufrechou (laurent-dufrechou) wrote : RE: [Bug 219558] Re: Integer error with shadow effect

Ok solved for me, thx!

-----Message d'origine-----
De : <email address hidden> [mailto:<email address hidden>] De la part de stani
Envoyé : dimanche 20 avril 2008 01:04
À : <email address hidden>
Objet : [Bug 219558] Re: Integer error with shadow effect

OK, fixed in bazaar:
$ bzr commit -m "fix: shadow bug for not rgb(a) images"
modified phatch/actions/shadow.py
Committed revision 512.

You can test the code with:
bzr lp: phatch

This fix will be included in the next version of phatch 0.1.4, which
will is scheduled for the 26th of april.

I'll prepare a debdiff immediately for Ubuntu Hardy in the hope it can
still be included.

--
Integer error with shadow effect
https://bugs.launchpad.net/bugs/219558
You received this bug notification because you are a direct subscriber
of the bug.

Status in Phatch = Photo & Batch!: Confirmed
Status in Source Package "phatch" in Ubuntu: Confirmed

Bug description:
Trying to apply a shadow effect on my picture make this error:

Error 0: Impossible d'appliquer l'action Ombre sur l'image 'marport_A1_Analyst.bmp' dans le dossier:
C:\Users\ldufrechou\Desktop

an integer is required

Action: {'fields': {'Background Colour': '#FFFFFF',
            'Border': '4%',
            'Force Background Colour': u'true',
            'Horizontal Offset': '2%',
            'Shadow Blur': u'3',
            'Shadow Colour': '#444444',
            'Vertical Offset': '2%',
            '__enabled__': u'true'},
 'label': 'Shadow'}

Traceback (most recent call last):
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\api.py", line 277, in apply_action
    photo = action.apply(photo,setting,cache)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\models.py", line 59, in apply
    photo = photo.apply_pil(self.pil,**values)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 377, in apply_pil
    self.get_layer().apply_pil(function,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\core\pil.py", line 399, in apply_pil
    self.image = function(self.image,*arg,**keyw)
  File "C:\Users\ldufrechou\Downloads\phatch-0.1.3.tar\phatch-0.1.3\phatch-0.1.3\phatch\actions\shadow.py", line 74, in drop_shadow
    image_mask = Image.new(mode,size,shadow_colour)
  File "C:\Python25\lib\site-packages\PIL\Image.py", line 1710, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required

Changed in phatch:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package phatch - 0.1.3-1ubuntu3

---------------
phatch (0.1.3-1ubuntu3) hardy; urgency=low

  * fix for shadows of not rgb(a) images (LP: #219558)

 -- Stani M <email address hidden> Sun, 20 Apr 2008 01:11:41 +0200

Changed in phatch:
status: Fix Committed → Fix Released
Revision history for this message
Stani (stani) wrote :

in latest version : 0.1.4.bzr526

Changed in phatch:
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

Remote bug watches

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