Invalid JPEG File Structure - importing jpegs into wings3d as references


#1

I hate it when I get this error in Wings3D

Failed to load “filename.jpg”: Invalid JPEG file structure: two SOI markers

This is driving me nuts. Can anyone figure out how to fix this. Or atleast the jpeg?


#2

I usually end up converting it to a bmp . it takes more memory but it works.:hmm:


#3

http://www.geocities.com/paulthepuzzles/aaimageplane.html

1). Obtain / create / prepare your reference image (pointless continuing if you’ve not got one :slight_smile: ) and ensure that it’s saved in BMP, TIFF or TGA format and 24 bit RGB colour. (Note that .tga supports clipping paths - so you can make that ‘dodgy’ background transparent :slight_smile: )

What isn’t said there, is that you can’t compress the tiffs or targas, so you will have a file that is basicaly the same size despite which of these three formats you choose to use. It’s realy too bad that one can’t use 8-bit .bmps, cause I always use greyscalled image planes anyways.


#4

I didn’t know what an SOI marker was so I did a bit of Googling and found out that it stands for Start Of Image and that each jpg starts off with a header FF D8 (that’s the SOI) and ends with FF D9 (that’s the end of image or EOI).

If you can look at the jpg with a hex editor you should be able to see that double SOI and put it right. I guess that’s the theory anyway as I don’t have a hex editor to test it out on.

Hope that helps. Good luck! :slight_smile:

swishy

Could someone post a double SOI jpg in the thread please as I want to try something. Thanks.


#5

well…here is a trick.

just open the image up in photoshop if it doesn’t work in wings3d…just go to file>save for web
and save it as that…it works fine if I do that.


#6

Seems like a pretty freakin expensive trick right there :slight_smile:
I’ve done the same using the Gimp tho,a bit cheaper.

As for the two SOI markers,it’d be real easy to fix with a hex editor.

Swishy:
Couldn’t find a jpg with this error,so I made one using XVI32 :slight_smile:
Took the sample ducky pic that came with windows,
and just added the second SOI header manually…
attached below,hope it helps a little :slight_smile:

[EDIT]
Wouldn’t let me attach it…told me it wasn’t a valid jpg file…
[/EDIT]


#7

As for the two SOI markers,it’d be real easy to fix with a hex editor.

pray explain.


#8

Thanks for trying to post an example jpg, dAfTiE.

I haven’t found any jpgs of my own that produce this error but I did find one that produced another error.

“Unsupported marker type 0x03”

Normally I run all my jpgs through JPG Cleaner to strip out any excess info in them but this one hadn’t been done as it was newly downloaded. After using JPG Cleaner Wings would accept it without giving the error. Was also able to use IrfanView’s “JPG Lossless Operations” plugin set to

Transformations (None)
Optimise JPG file (Unchecked)
Save with original date/time (Unchecked)
Clean all APP markers (Checked)

to achieve the same result.

I was going to try the same thing with a double SOI jpg possibly with the “Optimise JPG file” checked but if they won’t post I guess I can’t try that.

Glad you both found a workaround that works. :slight_smile:

swishy


#9

dpvtank:
Just go to http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm,
and download XVI32 from there.

Run it and open the jpg you want to fix.
Everything is ordered in cells in a way,so just look in the first one.

In a proper jpg file it should say FF in the first one and D8 in the second.
If there are two headers,meaning if there’s a second pair of FF D8 entries,
just delete the first pair and you’re good to go :slight_smile:


#10

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.