← Back to team overview

phatch-dev team mailing list archive

[Bug 384420] Re: Inaccurate opacity floating point calculations

 

Only the reflection action needs to be fixed. I've looked for 2[.]55
with regexxer.

** Changed in: phatch
       Status: New => In Progress

-- 
Inaccurate opacity floating point calculations
https://bugs.launchpad.net/bugs/384420
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:
when calculating the opacity, in the reflection and background actions (and possible others) we are using this method:
opacity = int(2.55 * opacity)
if opacity is 100 the result is:
int(2.55 * 100)= int(249.99999999999999) = 244

Which is generating inaccurate results. The correct way of calculating is:
opacity = (255 * opacity) / 100



References