File Info MLx Home | MLx menu | MLx buttons | Widgets | Index | What's New
This little widget adds some commands to the MLx menu for examining file header information.
Remove Verision Numbers
Removes the last semicolon and whatever follows it from all files in a folder.
Occasionally, when files are moved from another computer system, such as a VAX, they arrive with a version number: eg. image1.16b;1. The mac does not use the version numbers, and MacLispix doesn't like the them. This removes the version numbers for all files in the selected folder. It does not change file names with no version numbers.
Of course, this operation could be done manually in the finder, but it is tedious for large numbers of files.
Gatan Header Info
Prints out the Gatan file image small header information for the selected file.
Here is sample output for typical camera images:
File: DB2:Images DB2:EBS DF series 4/21/97:DF0.00 Dimensions: (512, 512) type: 2 byte signed integer (bytes per pixel: 2) ((image offset: 24))
The height and width are for the TRANSPOSED image, as MacLispix will read them.
If the image offset is 8, then the image is in the small header format. Otherwise, the image is in the DM2.5 format. (I have not yet updated to DM3.0).
This gives Mac system file information for the selected file. Here are examples:
(my hard disk):Internet Explorer 3.0 Mac file: Internet Explorer 3.0 Mac file type: APPL Mac file creator: MSIE (CREATE_DATE 0:00:00 Friday, 3 January, 1997) (LOCKED NIL) (WRITE_DATE 0:00:00 Friday, 3 January, 1997) Size (length): 1020005 bytes.
Note, for example, that the file creator is in the help_browser parameter. If you wish to use a third type of web browser (not Netscape or Internet Explorer), this information can be put in this parameter.
(my hard disk):test1.tiff Mac file: test1.tiff Mac file type: TIFF Mac file creator: CCL2 (CREATE_DATE 11:14:03 Monday, 18 November, 1996) (LOCKED NIL) (WRITE_DATE 11:14:03 Monday, 18 November, 1996) Size (length): 148906 bytes.
Here, the file creator is CCL2 (MCL, the language MacLispix is written
in), so that if this file is clicked on, it would be opened in MacLispix.
The way MacLispix opens files is not standard (the MLx -> Image
files menu) in that you have to know the image type (TIFF, raw, etc.)
before opening the file. So what happens, is that the finder switches to
MacLispix but does nothing else.
Change File Type
This displays the file type, and allows you to change it. An example might be to change a TEXT file to a TIFF file, if the file is an image that has been transferred from another computer and the file type information has been lost. Note that the type consists of four characters, and is case sensitive.
The TIFF image format has a place in the header for a character string of arbitrary length, giving information about the image. This command reads the description, but does not allow you to change it.
(my hard disk):test1.tiff "signed byte grayscale image"
TIFF Header Info
This gives the guts of the TIFF file header. The last item in these lists is the value or offset of the parameter. The tag number is used in place of the tag name for unusual tags.
? Tiff file header for (my hard disk):test1.tiff ((TAG SAMPLEFORMAT) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 2)) ((TAG RESOLUTIONUNIT) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 2)) ((TAG YRESOLUTION) (TYPE RATIONAL) (NUM_VALS 1) (VAL_OR_OFF 242)) ((TAG XRESOLUTION) (TYPE RATIONAL) (NUM_VALS 1) (VAL_OR_OFF 234)) ((TAG STRIPBYTECOUNTS) (TYPE LONG) (NUM_VALS 1) (VAL_OR_OFF 148656)) ((TAG ROWSPERSTRIP) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 228)) ((TAG SAMPLESPERPIXEL) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 1)) ((TAG STRIPOFFSETS) (TYPE LONG) (NUM_VALS 1) (VAL_OR_OFF 250)) ((TAG IMAGEDESCRIPTION) (TYPE ASCII) (NUM_VALS 28) (VAL_OR_OFF 206)) ((TAG FILLORDER) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 1)) ((TAG PHOTOMETRICINTERPRETATION) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 1)) ((TAG COMPRESSION) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 1)) ((TAG BITSPERSAMPLE) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 16)) ((TAG IMAGELENGTH) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 228)) ((TAG IMAGEWIDTH) (TYPE SHORT) (NUM_VALS 1) (VAL_OR_OFF 326)) ((TAG NEWSUBFILETYPE) (TYPE LONG) (NUM_VALS 1) (VAL_OR_OFF 0)) ?
This prints out the actual bytes in a file -- similar to a memory dump. Other applications do this sort of thing better, and allow editing of the contents of the file. This widget only prints the information. There are various options - here are examples for near the beginning of the TIFF file for which the header information is shown above:
The left hand collumn shows the position of the beginning of the line in bytes. The top of the tables for the HEx and ASCII give the number for that collumn also:
|ASCII Most of the characters are not printable. The exception is the image description after byte 180.|
The number beside each character is the value of the byte in Hexidecimal.
The number beside the character is the value of the byte in decimal.
|Longword The data is grouped in longwords (4 bytes), values of each byte in decimal.|