Re: Bad encoding of colour images in jfor

Bertrand Delacretaz <[email protected]> Fri, 2 Aug 2002 10:06:04 +0200
Newsgroups gmane.text.xml.jfor.devel
Organization codeconsult
Message-ID <[email protected]>
On Friday 02 August 2002 09:57, Boris Poudérous wrote:
> I have just tried with a png image. We were right : the problem comes from
> the encoders.

Maybe writing a main() function to test the org.jfor.jfor.tools.jpeg.Encoder 
class standalone would show the problem?

> But the image is anormally stretched vertically. So there is also a problem
> with png format.

From a quick look at the code, the width and height are taken from the PNG 
data itself:

if (type == ImageConstants.I_PNG) {
	width = ImageUtil.getIntFromByteArray(data, 16, 4, true);
	height = ImageUtil.getIntFromByteArray(data, 20, 4, true);
}

so maybe there's a problem here too, which is not necessarily related.

-Bertrand


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf