Tamogen ZeroDivisionError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Phatch |
Fix Released
|
Medium
|
Juho Vepsäläinen | ||
phatch (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
While running the test suite on the tamogen action I got this error:
ERROR:actionlist: /home/nadia/
Error 0:Can not apply action Tamogen on image 'fish.gif' in folder:
/home/nadia/
float division
Action:{'fields': {'Canvas Height': '100%',
'Canvas Width': '100%',
'Fill Folder': '<folder>
'Fill Image': '<path>',
'Fill Type': u'Folder',
'Rows': u'1000',
'label': 'Tamogen'}
Traceback (most recent call last):
File "/home/
photo = action.apply(photo, read_only_settings, cache)
File "/home/
photo.
File "/home/
self.image = function(
File "/home/
canvas_width, canvas_height, fill_image, fill_folder)
File "/home/
fill_img, tone_diff = fill_images.
File "/home/
image_avg = sum(Stat(
File "/usr/lib/
v = getattr(self, "_get" + id)()
File "/usr/lib/
v.append(
ZeroDivisionError: float division
*
I'm attaching the actionlist and the image to reproduce the error.
Changed in phatch: | |
milestone: | 0.2.1 → 0.2.2 |
summary: |
- tamogen ZeroDivisionError + Tamogen ZeroDivisionError |
Changed in phatch: | |
status: | Confirmed → In Progress |
Changed in phatch: | |
status: | In Progress → Fix Committed |
Changed in phatch (Ubuntu): | |
status: | New → Confirmed |
Changed in phatch: | |
status: | Fix Committed → Fix Released |
Try this: other/tamogen. py' other/tamogen. py 2009-09-21 04:26:34 +0000 other/tamogen. py 2009-10-02 05:11:31 +0000
=== modified file 'phatch/
--- phatch/
+++ phatch/
@@ -39,7 +39,7 @@
assert filltype in FILL_TYPES
fill_size = (x_pix, y_pix)
- num_squares = (x_squares, y_squares)
+ num_squares = (min(x_squares, x_pix), min(y_squares, y_pix))
final_img = Image.new(im.mode, fill_size)
fill_ section_ size = get_section_ size(fill_ size, num_squares)