phatch-dev team mailing list archive
-
phatch-dev team
-
Mailing list archive
-
Message #00139
[Bug 384522] Re: Setting a too low JPG Maximum size
Please test to be sure.
$ bzr diff
=== modified file 'phatch/core/lib/imtools.py'
--- phatch/core/lib/imtools.py 2009-06-08 12:17:51 +0000
+++ phatch/core/lib/imtools.py 2009-06-09 15:12:39 +0000
@@ -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"
Committing to: /home/stani/sync/python/phatch/trunk/
modified phatch/core/lib/imtools.py
Committed revision 711.
** Changed in: phatch
Status: In Progress => Fix Committed
--
Setting a too low JPG Maximum size
https://bugs.launchpad.net/bugs/384522
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.
Status in Phatch = Photo & Batch!: Fix Committed
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.
References