[IPOL discuss] libpng

Julien Rabin rabin.julien at gmail.com
Mon Jul 25 21:42:34 CEST 2011


Dear all,

Nicolas told me that this has been corrected a month ago.

Best,

Julien

2011/7/25 Miguel Colom <Miguel.Colom at cmla.ens-cachan.fr>

> > I think there may have a bug in the 'io_png.c' file provided on IPOL.
> > while (ptr_gray < ptr_end)
> >>             *ptr_gray++ = (unsigned char) ((6969.f * *ptr_r++
> >>                                            + 23434.f * *ptr_g++
> >>                                            + 2365.f * *ptr_b++) /
> >> 32768.f);
>
> Indeed, I think that to be 100% correct we should apply a round() function
> before the (unsigned char) cast to avoid just truncating the value instead
> of rounding it to the nearest integer.
>
> Best,
> Miguel
>
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>



-- 
Julien Rabin
Post-Doctorant au CMLA <http://www.cmla.ens-cachan.fr/>, ENS de Cachan
tel. CMLA : 01-47-40-59-42
tel. portable : 06-87-39-58-26
web  : http://www.tsi.enst.fr/~rabin/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20110725/8192ac56/attachment.htm>


More information about the discuss mailing list