phatch-dev team mailing list archive
-
phatch-dev team
-
Mailing list archive
-
Message #00722
[Bug 440273] Re: Tamogen ZeroDivisionError
** Changed in: phatch
Status: Confirmed => In Progress
--
Tamogen ZeroDivisionError
https://bugs.launchpad.net/bugs/440273
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.
Status in Phatch = Photo & Batch!: In Progress
Bug description:
While running the test suite on the tamogen action I got this error:
ERROR:actionlist: /home/nadia/projects/phatch/tests/output/actionlists/convert_mode_tamogen_Mode=1_FillType=Folder_Rows=1000_Columns=1.phatch generated the following logs:
Error 0:Can not apply action Tamogen on image 'fish.gif' in folder:
/home/nadia/projects/phatch/tests/input
float division
Action:{'fields': {'Canvas Height': '100%',
'Canvas Width': '100%',
'Columns': u'1',
'Fill Folder': '<folder>/<subfolder>',
'Fill Image': '<path>',
'Fill Type': u'Folder',
'Rows': u'1000',
'__enabled__': 'yes'},
'label': 'Tamogen'}
Traceback (most recent call last):
File "/home/nadia/projects/phatch/phatch/core/api.py", line 608, in apply_action_to_photo
photo = action.apply(photo, read_only_settings, cache)
File "/home/nadia/projects/phatch/phatch/core/models.py", line 106, in apply
photo.get_layer().apply_pil(self.pil, **values)
File "/home/nadia/projects/phatch/phatch/core/pil.py", line 709, in apply_pil
self.image = function(self.image, *arg, **keyw)
File "/home/nadia/projects/phatch/phatch/actions/tamogen.py", line 42, in mosaic
canvas_width, canvas_height, fill_image, fill_folder)
File "/home/nadia/projects/phatch/phatch/other/tamogen.py", line 81, in mosaic
fill_img, tone_diff = fill_images.findClosestImageAndToneDiff(bsection)
File "/home/nadia/projects/phatch/phatch/other/tamogen.py", line 108, in findClosestImageAndToneDiff
image_avg = sum(Stat(diff_image).mean)
File "/usr/lib/python2.5/site-packages/PIL/ImageStat.py", line 64, in __getattr__
v = getattr(self, "_get" + id)()
File "/usr/lib/python2.5/site-packages/PIL/ImageStat.py", line 120, in _getmean
v.append(self.sum[i] / self.count[i])
ZeroDivisionError: float division
*
I'm attaching the actionlist and the image to reproduce the error.
References