Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwkendrick <wkendrick>2011-07-25 17:00:55 (GMT)
committer wkendrick <wkendrick>2011-07-25 17:00:55 (GMT)
commit13bbae71846d319d2bbfa72a3df4e93dd467e7e6 (patch)
tree681f7fc2b6e31aa1a4299eb84d28d15ddbd579d5
parent8663a61765000ffb6cd6726997ce5c7f6bc41d67 (diff)
Gamma corrected '255' was coming out as '254.999985', so wrapping gamma-to-linear conversion in a ceil() call to avoid turning white into off-white (e.g., when loading an 800x600-window image into a 640x480-window Tux Paint; see Pere's email from this week).
-rw-r--r--src/tuxpaint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 884315d..07cb425 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - June 24, 2011
+ June 14, 2002 - July 25, 2011
*/
@@ -9256,9 +9256,9 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y,
ta = ta / tmp;
#ifdef GAMMA_CORRECTED_THUMBNAILS
- tr = pow(tr, gamma_invert);
- tg = pow(tg, gamma_invert);
- tb = pow(tb, gamma_invert);
+ tr = ceil(pow(tr, gamma_invert));
+ tg = ceil(pow(tg, gamma_invert));
+ tb = ceil(pow(tb, gamma_invert));
#endif
if (keep_alpha == 0 && s->format->Amask != 0)