[sane-devel] sane-canon: Endian inverted data when scanning 48bbp raw mode pnm

Henning Meier-Geinitz henning at meier-geinitz.de
Wed Dec 28 11:18:21 UTC 2005


Hi,

On Wed, Dec 28, 2005 at 10:58:14AM +0100, Ulrich Deiters wrote:
> However, I thought that the PNM standard specifies the byte order.
> Please advise me if this is wrong.

The pnm standard specifies the byte order for files saved in pnm
format. 

However, the backend does not know what's done with the data at all
(e.g. in which format it's saved). So the pnm format is only important
for frontends that use this format to save images.

For backends, the SANE standard applies and that one specifies: "the
bytes of each sample value are transmitted in the machine's native
byte order". Therefore, on little endian machines, data sent to the
frontend by sane_read() must be little endian (and big endian on big
endian machines).

Bye,
  Henning



More information about the sane-devel mailing list