[Info-vax] proper format for JPEG files

Mark Berryman mark at theberrymans.com
Wed Jul 27 16:25:07 EDT 2011


On 7/23/11 1:52 PM, Phillip Helbig---undress to reply wrote:
> What is the "proper" format for JPEG files on VMS, in particular if they
> are served by a web server and displayed in a web browser?  I have some
> which are
>
>     Record format:      Fixed length 512 byte records
>     Record attributes:  None
>
> and some which are
>
>     Record format:      Stream_LF, maximum 0 bytes, longest 32767 bytes
>     Record attributes:  Carriage return carriage control
>
> and both work.  (The former were transferred via FTP from a Windows
> system (sorry, I don't have a VMS machine with a DVD reader) and the
> latter saved from the web via a web browser.)
>
Both are valid although a poorly coded program can choke on either one. 
  I've seen a number of Unix utilities that were simply compiled, not 
ported, on VMS that choke on the first format.  Anything that uses RMS 
$GET code will choke on the second.

Any program you have for reading JPEG files is likely written in C.  The 
CRTL uses block-mode I/O and does its own internal buffering.  For C 
programs, it all depends on how the file is opened.  There are a number 
of permutations that work.  For me, the easiest is to use "ctx=rec" if I 
expect to be reading records (it doesn't matter if the file is a stream 
format or a variable record format) or "ctx=stream" if I am reading 
binary data.  Using "ctx=stream" will read raw data regardless of the 
file format.

RMS assumes records.  If you wish to read non-record oriented data using 
RMS, the file format must either be fixed-length records or you must use 
RMS block I/O.

Mark Berryman

--- Posted via news://freenews.netfront.net/ - Complaints to news at netfront.net ---



More information about the Info-vax mailing list