XLITO(1)

πŸ‘‘ XLITO(1) β€” the xlito manual page, bestie edition πŸ’…

okay so you opened the xlito(1) man page from the General Commands Manual and you're like "what is this tiny chaos gremlin" β€” bestie, let me tell you. Sit down. Grab a strawberry πŸ“.


✨ NAME ✨

xlito β€” Append/Delete/Show a Trailing Option string in a file.

(also known as XLoadImageTrailingOptions, which is a whole mouthful, so we're calling her xlito, periodt πŸ‘‘)


🌈 SYNOPSIS 🌈

xlito [option] [string] files ...

πŸ’– DESCRIPTION πŸ’–

so xlito (XLoadImageTrailingOptions) is this little utility that gives you a file-format-independent way of marking image files with the exact options they need to display correctly. no cap. it does this by appending a string β€” one that you, the user, specify β€” onto a file. and that string is marked with some magic numbers so a program that knows what to look for can scoop it back out. ✨

the way that almost all image files have some sort of image dimension info baked in, the programs that load or manipulate them generally don't look past the point where they've read the complete image. so trailing info is just... safely hidden back there. living its little secret life. πŸ™ˆ if appending this info causes trouble with other utilities, you can literally just delete it. no drama.

an appropriate version of xloadimage (ie. xli 1.00) will recognise these trailing options at the end of the image files, and will treat the embedded string as if it were a sequence of command line Image Options. but heads up: any Global Options get ignored, and unlike command line Image Options, Trailing Options are never propagated to other images. nope. they stay in their lane.

old versions of xloadimage (3.01 or less) can be made forward compatible by using the -x option to pull the trailing options out of the image files and put them on the command line where xloadimage can actually see them. teamwork 🫢


πŸŽ€ OPTIONS πŸŽ€

the default behavior is to display the trailing option strings (if any) of the files on the argument line. the following options change the behavior of xlito:

  • -c option_string file_name ... β€” this adds or changes the embedded string to option_string. the string will have to be quoted if it's composed of more than one word. (yes, quoting matters. she's picky. πŸ’…)
  • -d file_name ... β€” delete any embedded trailing option strings in the given files. bye bye πŸ‘‹
  • -x file_name ... β€” process the files and create a command line string suitable for use by xloadimage. arguments starting with - are echoed, arguments not starting with - are treated as files, and any trailing options strings are echoed followed by the file name. the xloadimage option -name is treated correctly. iconic behavior fr fr.

🌸 EXAMPLES 🌸

say fred.gif has the wrong aspect ratio (rude of it), so it might need viewing with the xloadimage options:

xloadimage -yzoom 130 fred.gif

this option can then be appended to the file by:

xlito -c "-yzoom 130" fred.gif

and from then on, some new versions of xloadimage will get the appropriate options from the image file itself. slay. and old versions of xloadimage can be made to work by using:

xloadimage `xlito -x fred.gif`

you can make it transparent by using a script containing something like:

xloadimage `xlito -x $βˆ—`

the script could be called xli for instance. πŸ‘‘

and the options can be deleted with:

xlito -d fred.gif

πŸ’œ AUTHOR πŸ’œ

Graeme Gill Labtam Australia graeme@labtam.oz.au


πŸ¦‹ MAINTAINER πŸ¦‹

smar@reptiles.org


⭐ COMPATIBILITY WITH IMAGE FILES ⭐

okay this part is important, bestie, listen up. some image files are actually ascii files that get used in other contexts. X Bitmap files are the example here. they're formatted as 'C' style #defines and an initialised array of characters, so they can be included in 'C' source code. so adding trailing options would therefore render the file unusable with a compiler, since it will get a syntax error on the trailing option string and the magic numbers. 😭 oops.

the solution to this is that xlito will ignore a certain amount (a few hundred bytes) after the trailing options, and uses a padding of 20 bytes before the trailing options. these two areas will be maintained when changing an existing trailing option. and in the case of an X bitmap, the solution is to edit the file and place the embedded string in some 'C' comments. chef's kiss 🧚

eg: say the file starts as:

#define tt_width 4
#define tt_height 4
static char tt_bits[] = {
   0x08, 0x02, 0x04, 0x01};

and you add a trailing options:

#define tt_width 4
#define tt_height 4
static char tt_bits[] = {
   0x08, 0x02, 0x04, 0x01};
01234567890123456789XXX xloadimage trailing options
XXX0007"-smooth"0007XXX
xloadimage trailing options XXX

then the trailing options can be commented out:

#define tt_width 4
#define tt_height 4
static char tt_bits[] = {
   0x08, 0x02, 0x04, 0x01};
/βˆ—234567890123456789XXX xloadimage trailing options
XXX0007"-smooth"0007XXX
xloadimage trailing options XXX βˆ—/

πŸ’€ BUGS πŸ’€

xlito doesn't cope with compressed files. a file will need uncompressing, the options added, and then compressing again. that's just the gig. ngl. 😭


and that's the whole page, bestie. no notes. πŸ’…

kisses from the 7 Jul 1993 release of the XLITO(1) page** β€” that's the version and date stamped on this whole thing, and yes she's vintage, she's a classic, she's older than most of us and still serving. πŸŽ€βœ¨πŸ¦‹