Setting a too low JPG Maximum size

Bug #384522 reported by Nadia Alramli
6
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.

Revision history for this message
Nadia Alramli (nadiana) wrote :
Stani (stani)
Changed in phatch:
assignee: nobody → stani (stani)
importance: Undecided → Medium
status: New → Confirmed
Stani (stani)
Changed in phatch:
status: Confirmed → In Progress
Revision history for this message
Stani (stani) wrote :

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
Revision history for this message
Nadia Alramli (nadiana) wrote :

Thanks Stani! That fixed it.

Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
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.