Big/little-endian DPX files... how to load...

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
lombrozo

Big/little-endian DPX files... how to load...

Post by lombrozo »

Hi,

I wonder if you can help.

I am writing a DPX loader and have noticed a number of files with bad 'magic number' elements in the file-information-header. Specifically, the magic number is SDPX when it should be XPDS, indicating big-endian instead of little-endian.

I see that XnView can still read DPX files even if this magic-number is the wrong way round. Also, if I load a DPX file using XnView with the magic-number the wrong way round, then save it using XnView, XnView saves the magic-number the CORRECT way round!

Since the magic-number is the only means of determining the big/little-endian order, how are you determining which way to read the file when the magic-number is the wrong way round?

I hope you can help, thanks,

Simon
User avatar
xnview
Author of XnView
Posts: 46253
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Big/little-endian DPX files... how to load...

Post by xnview »

lombrozo wrote:Hi,

I wonder if you can help.


I am writing a DPX loader and have noticed a number of files with bad 'magic number' elements in the file-information-header. Specifically, the magic number is SDPX when it should be XPDS, indicating big-endian instead of little-endian.

I see that XnView can still read DPX files even if this magic-number is the wrong way round. Also, if I load a DPX file using XnView with the magic-number the wrong way round, then save it using XnView, XnView saves the magic-number the CORRECT way round!

Since the magic-number is the only means of determining the big/little-endian order, how are you determining which way to read the file when the magic-number is the wrong way round?
I use only this magic number to know if i'm in little or big endian.
Pierre.
Post Reply