Discussion:
[GM-apis] Returning "Endian" for a given image file (C++ interface)
JongAm Park
2012-01-20 17:14:22 UTC
Permalink
When a DPX image in little endian format was opened, I found out that it was to be saved in big endian format.
So, it doesn't preserve the source endian.

Also, I noticed that it returned "UndefinedEndian" type when "endian()" is called.
Probably setting endian using endian( const EndianType endian_ ) will make the output file in that endian, but I think it should return the source's endian type when endian() is called, and when specific endianness is not specified, saving that image should preserve the source's endianness.

is anybody aware of this?

Thanks,
Bob Friesenhahn
2012-01-20 18:50:45 UTC
Permalink
When a DPX image in little endian format was opened, I found out that it was to be saved in big endian format.So, it doesn't
preserve the source endian.
It should use the current CPU's endianness if you specify

image.endian(NativeEndian);
Also, I noticed that it returned "UndefinedEndian" type when "endian()" is called.
Probably setting endian using endian( const EndianType endian_ ) will make the output file in that endian, but I think it
should return the source's endian type when endian() is called, and when specific endianness is not specified, saving that
image should preserve the source's endianness.
The big endian format is used by default because at one time virtually
all DPX files were big endian and there was substantial software which
did not know how to parse little endian.

I agree that it would be nice if image.endian() returned the
endianness of the file which was just read.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Bob Friesenhahn
2012-01-21 17:05:32 UTC
Permalink
When a DPX image in little endian format was opened, I found out that it was to be saved in big endian format.So, it
doesn't preserve the source endian.
This issue is now fixed in Mercurial, changeset 7087e4e47aee. It will
be in the next snapshot I prepare, as well as the next release.
Also, I noticed that it returned "UndefinedEndian" type when "endian()" is called.
This problem is fixed as well. The original endianness is now set in
the image so that it will be returned by the endian() method.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
JongAm Park
2012-01-21 21:34:47 UTC
Permalink
Wow!!! Thank you so much!

Sent from my iPhone
When a DPX image in little endian format was opened, I found out that it was to be saved in big endian format.So, it
doesn't preserve the source endian.
This issue is now fixed in Mercurial, changeset 7087e4e47aee. It will be in the next snapshot I prepare, as well as the next release.
Also, I noticed that it returned "UndefinedEndian" type when "endian()" is called.
This problem is fixed as well. The original endianness is now set in the image so that it will be returned by the endian() method.
Bob
--
Bob Friesenhahn
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Loading...