Christopher Martin | 6 Nov 2005 17:38
Picon
Favicon

Re: PNG file gamma not handled

On October 27, 2005 12:46, Lubos Lunak wrote:
> On Thursday 27 of October 2005 17:32, Christopher Martin wrote:
> > Hello,
> >
> > It seems that neither Qt nor Gwenview handle gamma values associated
> > with PNG files correctly. For instance, the images at
> > http://www.christian-seiler.de/temp/gamma.html look different in
> > Mozilla/Firefox, as they should, but unless your Qt is patched, they
> > will look identical in Konqueror (the patch to fix this is in qt-copy,
> > but looks a little dodgy).
> >
> > Gwenview seems to borrow code from Qt, and it inherits this problem.
> > The attached patch seems to fix the issue, so that the images at the
> > above link (and those at http://www.w3.org/Graphics/PNG/all_seven.html,
> > another handy site) all look correct when viewed in Gwenview.
>
>  The PNG decoder in Gwenview is more or less a copy of the one in Qt,
> with some modifications (I don't remember exactly why right now), so the
> qt-copy patch should apply to it as well.
>
>  I've sent a patch to the person who created the patch asking about the
> status.

It looks like the qt-copy patch has been dropped, in favour of a fix in 
kdelibs itself.

Since this new fix doesn't solve Gwenview's issue, then my patch is still 
needed.

Cheers,
(Continue reading)

Lubos Lunak | 7 Nov 2005 14:22
Picon

Re: PNG file gamma not handled

On Sunday 06 of November 2005 17:38, Christopher Martin wrote:
> On October 27, 2005 12:46, Lubos Lunak wrote:
> > On Thursday 27 of October 2005 17:32, Christopher Martin wrote:
> > > Hello,
> > >
> > > It seems that neither Qt nor Gwenview handle gamma values associated
> > > with PNG files correctly. For instance, the images at
> > > http://www.christian-seiler.de/temp/gamma.html look different in
> > > Mozilla/Firefox, as they should, but unless your Qt is patched, they
> > > will look identical in Konqueror (the patch to fix this is in qt-copy,
> > > but looks a little dodgy).
> > >
> > > Gwenview seems to borrow code from Qt, and it inherits this problem.
> > > The attached patch seems to fix the issue, so that the images at the
> > > above link (and those at http://www.w3.org/Graphics/PNG/all_seven.html,
> > > another handy site) all look correct when viewed in Gwenview.
> >
> >  The PNG decoder in Gwenview is more or less a copy of the one in Qt,
> > with some modifications (I don't remember exactly why right now), so the
> > qt-copy patch should apply to it as well.
> >
> >  I've sent a patch to the person who created the patch asking about the
> > status.
>
> It looks like the qt-copy patch has been dropped, in favour of a fix in
> kdelibs itself.
>
> Since this new fix doesn't solve Gwenview's issue, then my patch is still
> needed.

(Continue reading)

Christopher Martin | 7 Nov 2005 15:09
Picon
Picon
Favicon

Re: PNG file gamma not handled

On November 7, 2005 08:22, Lubos Lunak wrote:
>  I've pointed Brah Hards, the author of the qt-copy patch, to the
> kfm-devel posts, because he said ... well, see below. Besides that, I
> don't really understand this stuff, the png loader is just a copy from Qt
> fix some fixes, so I'm no authority on this. If the patch's made it into
> khtml, feel free to commit it to gweview too.

<snip>

> >  I see. Note that on the Gwenview mailing list the Debian asked us to
> > fix the problem too, but his patch is different and he says your patch
> > has problems too.
> > (http://sourceforge.net/mailarchive/forum.php?thread_id=8823928&forum_i
> >d=12 10)
>
> I had a look, but there appears to be confusion between screen gamma, and
>  file gamma. There is a (bad) description in the libpng docs about this.

Well, all I can say is that my patch makes Gwenview pass the tests at 
http://www.w3.org/Graphics/PNG/all_seven.html and 
http://www.christian-seiler.de/temp/gamma.html. It sets a non-zero screen 
gamma, using the default value that 1) Brad's original patch used, and 2) 
that khtml now hardcodes [1], in order to work around an issue in Qt 
whereby file gamma is ignored if screen gamma is set to zero (you can see 
this problem in Qt/Gwenview's code very easily).

Unfortunately, Brad's comments don't seem very clear - it's not obvious 
which patch he's referring to as 'confused'. The khtml patch isn't 
applicable to Gwenview, but I believe that my patch does the same basic 
thing, namely, hardcode a sensible default (non-zero) screen gamma. If it 
(Continue reading)


Gmane