Setting a too low JPG Maximum size
Bug #384522 reported by
Nadia Alramli
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Phatch |
Fix Released
|
Medium
|
Stani |
Bug Description
I'm attaching two action lists: case1.phatch and case2.phatch and one photo
The second action list case2.phatch sets the JPG Maximum size to 30 KB which is possible. But the resulting size is 37.7 KB instead of 30 KB.
The first action list case1.phatch sets the JPG Maximum size to 10 KB which is apparently impossible. Calculation result is a zero quality which PIL is ignoring. To fix this we need to check if the quality equals zero and set it to 1.
Changed in phatch: | |
assignee: | nobody → stani (stani) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in phatch: | |
status: | Confirmed → In Progress |
Changed in phatch: | |
milestone: | none → 0.2.1 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Please test to be sure.
$ bzr diff core/lib/ imtools. py' core/lib/ imtools. py 2009-06-08 12:17:51 +0000 core/lib/ imtools. py 2009-06-09 15:12:39 +0000
=== modified file 'phatch/
--- phatch/
+++ phatch/
@@ -36,7 +36,7 @@
if options is None:
options = {}
q = options['quality'] = (down+up)/2
- if q==down or q==up: return q
+ if q==down or q==up: return max(q,1)
s = get_size(im, format, **options)
if abs(s-size)<delta:
return q
$ bzr commit -m "fix too low JPG Maximum size" sync/python/ phatch/ trunk/ core/lib/ imtools. py
Committing to: /home/stani/
modified phatch/
Committed revision 711.