Sorry for the poor post early. I thought I could cut time by 
forwarding the post. The following is a post I made to the group some 
time ago about the extraneous bytes error message:

=========== Original message ===========
This post started as a request for help but has ended up as a FYI 
post.

I have quite a few jpegs with "extraneous bytes before marker 0xed".

The images can be opened in PS, IrfanView and browsers so the 
corruption is not fatal but, mostly as an exercise, I wanted to try 
and remove the error.

I could convert the files to remove the error but that would apply 
the encoding again and would lead to some, albeit minute,  
degradation of the image.

What I wanted was to do is open the files in a hex editor, find the 
marker, delete x number of bytes before the marker and save the 
image. 

Trying to find the hex value was a little tough. After doing a lot of
searching for 'ed'  in Hex edit mode of WinVi32, the most obvious
candidate looks like a section that reads like

00 00 00 00 ff ed 7d

Where 00 goes back about 30 lines. So the marker sequence to find was 
"ff ed 7d". In the 3 cases I looked at the extraneous bytes were null 
or 00.  

So to remove the extra bytes, highlight the first null characters 
prior to 'ff ed' back to the first occurrence of 00 in that sequence. 
Delete the highlighted section, save the file with a new name. Open 
it in a graphics package and run identify to check that the image is 
sane. If your happy, overwrite original corrupted file with your new 
version.  

The only real benefit I have found in doing this is that graphics 
packages (namely PS) will open the file a little quicker. As far as I 
can tell this process has not tampered with any of the other file 
attributes such as ICC/IPTC/EXIF profiles and the preview image 
remains intact.  

Away, HTH.
Dp.

==============

On 29 Jan 2007 at 16:17, Jørn Dahl-Stamnes wrote:

> Hello folks,
> 
> I use IM to create thumbnails etc when uploading an jpeg image to a
> web-site. I have tested the PHP on a test-server without any problems.
> 
> Today I installed the PHP code and IM on a new web-server. After a few
> tests I noticed the following error messages in the apahce web-servers
> error log file:
> 
> identify: Corrupt JPEG data: 59 extraneous bytes before marker 0xd6
> `/tmp/imgCXhlB6'. convert: Corrupt JPEG data: 59 extraneous bytes
> before marker 0xd6 `/tmp/imgCXhlB6'. identify: Corrupt JPEG data: 1
> extraneous bytes before marker 0xe1 `/tmp/imgmzstBl'. convert: Corrupt
> JPEG data: 1 extraneous bytes before marker 0xe1 `/tmp/imgmzstBl'.
> 
> Both the image and the thumbnail is stored in a MySQL database (in a
> BLOB field). It display correctly when viewed from a browser.
> 
> The original file has been created in PhotoShop CS 2. Using identify
> on them does not create any errors. So what does the error message
> trying to say? Extra bytes added to the end fo the file or?
> 
> Current version:
> Version: ImageMagick 6.2.9 01/29/07 Q16 http://www.imagemagick.org
> Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
> 
> -- 
> Jørn Dahl-Stamnes
> homepage: http://www.dahl-stamnes.net/dahls/
> 
> _______________________________________________
> Magick-users mailing list
> [email protected]
> http://studio.imagemagick.org/mailman/listinfo/magick-users



_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to