[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] image.load() works for some Jpeg's, but not others.



I say just convert them to .png,  pygame handles those fine.

--- On Mon, 12/7/09, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:

From: Lenard Lindstrom <len-l@xxxxxxxxx>
Subject: Re: [pygame] image.load() works for some Jpeg's, but not others.
To: pygame-users@xxxxxxxx
Date: Monday, December 7, 2009, 2:13 PM

Hi Sandy,

Sandy Walsh wrote:
> More on this. If I open the file with PIL first and resave it, it works with Pygame.
>
> Hope it helps,
> Sandy
>
>
> Sandy Walsh wrote:
>> I get jpeg images from about six different IP cameras. I know there is different firmware in each of them. One of them gives a jpeg that can be read via image.load() the others all throw an unrecognized format exception. Obviously the problem is in the camera firmware, but the real problem is that windows image viewer and nearly every other application can open these files without problem. So it makes me concerned that the loader for pygame is less forgiving than these standard applications. I'm attaching a sample of the jpegs for your review. Only Cam185.jpeg can be opened by image.load().
>>
Pygame on Windows used libjpeg 6b. JPEG is a compression technique, not a file format. All the attached files look like they have a broken JFIF format header. The unrecognized ones have two extra null bytes in the header.

Pygame is primarily a game package. It uses readily available libraries that meet the licensing requirements. It cannot be expected to be as forgiving as image viewers or editors.

Lenard Lindstrom