Endian again :-<

Kiyo Inaba <inaba@src.ricoh.co.jp> Wed, 08 July 1992 12:20 UTC

Received: from ietf.nri.reston.va.us by IETF.NRI.Reston.VA.US id aa02837; 8 Jul 92 8:20 EDT
Received: from NRI.NRI.Reston.Va.US by IETF.NRI.Reston.VA.US id ab02831; 8 Jul 92 8:20 EDT
Received: from stubbs.ucop.edu by NRI.Reston.VA.US id aa08593; 8 Jul 92 8:21 EDT
Received: by stubbs.ucop.edu (5.57/1.34) id AA18729; Wed, 8 Jul 92 04:43:17 -0700
Received: from snoopy.src.ricoh.co.jp by ricohgwy.ricoh.co.jp (5.65+1.5W) id AA17819; Wed, 8 Jul 92 20:55:53 JST
Received: by snoopy.src.ricoh.co.jp (5.51/6.4J.6-90Jun26) id AA14701; Wed, 8 Jul 92 20:55:49+0900
Date: Wed, 08 Jul 1992 20:55:49 +0900
From: Kiyo Inaba <inaba@src.ricoh.co.jp>
Return-Path: <inaba@src.ricoh.co.jp>
Message-Id: <9207081155.AA14701@snoopy.src.ricoh.co.jp>
To: netfax@stubbs.ucop.edu
Subject: Endian again :-<
Cc: inaba@src.ricoh.co.jp

Colleagues,

I encountered the old problem again when I revise my fax modem
control software. The detail is as follows:

Since there is a standard to store fax images (of course, I mean
RFC1314), I changed the file format used for my program from the
old 'cat'ed sun raster file to TIFF/F. When I finish, I try to
check it with tiff reader in X11R5 release (fax2tiff). The program
complains much about my format.

After several minutes's thought, I found that fax2tiff assumes
each image data bytes are encoded as Most Significant Bit first
order. But my program encode image by LSB first. For example,
a run-code for white 0 pixel is encoded as follows
	00110101	bit-representation in ccitt T.4
	0x35		fax2tiff's encoding
	0xac		MY encoding

Because ccitt X.4 defines Least Significant Bit shall be sent first,
(or the first bit received shall be Least Significant Bit), I think
my interpretation is more natural than tiff library's interpretation.

But, of course, the tiff library is so popular, I don't want to make
the net world as Gulliver's Travel. So, my questions are

1) Is the tiff library's interpretation is common or my interpretation
	is common?
2) Is this interpretation affected by the two bytes magic number 'MM'
	and 'II'?
3) Isn't it better to define this issue in RFC?

B.T.W, the fax modem controlled software mentioned above is freely available
	on "ricohgwy.co.jp:pub/net/fax", but currently it only supports
	Ricoh's Fax Modem, which does not use AT+F command set, sigh :-<

Kiyo Inaba
Ricoh Co. Ltd