Re: [GD-DEVEL] Premature end of JPEG file
| From: | Pierre | Date: | Wed, 17 Oct 2007 08:56:24 +0000 |
| Subject: | Re: [GD-DEVEL] Premature end of JPEG file | ||
| References: | 1 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-269@lists.php.net to get a copy of this message | ||
Hi Franky,
On 10/16/07, Franky Braem <franky.braem@gmail.com> wrote:
> Hi,
>
> I'm porting GD to javascript in my wxJavaScript program. Everything
> works fine, except for loading jpeg images. When I load it with
> gdImageCreateFromJpeg, I get the following error:
>
> 21:54:41: wxJS: Running Scriptfile
> c:\development\wxjs\wxJS2\samples\gd\load.js
> Premature end of JPEG file
> gd-jpeg: JPEG library reports unrecoverable error: Invalid JPEG file
> structure:
> missing SOS marker
> 21:54:44: Error: wxJS: c:\development\wxjs\wxJS2\samples\gd\load.js(1) :
> Class ImageJPEG can't be constructed
> 21:54:44: Error: Evaluating script failed
The only possible error I can think about is the mode you use to read
the file. Do you use the binary mode with fopen?
> I can open the Jpg-file with IrfanView without any problem. The image is
> created with gdImageJpeg.
That's expected, gd creates valid jpeg :)
Best,
--Pierre