Many historical images, such as census records, and other data image files are much too big for me to view without my Zaurus crashing, so I have written a script that enables me, using command line image tools via ssh to a remote host box, to pick the piece of the file I want to read, called
If you have not already done so, I recommend that you read the companion page to this one, which gives some background and discusses various other ways of modifying images to make them more PDA friendly.
Image cropping with
So, to use
I have done my best to make
For example, if I want the top fourth of "firstimage.jpg", I would enter the command:
and it would create a file called "firstimage-top-4th.jpg". I am not going to reproduce the console output here as it shows the progress of the script for debugging purposes, and is quite lengthy.
If I want the left half of
"another.tiff", I would enter the command:
./crop.sh left half another.tiff
and it would create a file called
WARNING: Make your own backup copy of important images. I do not recommend processing irreplaceable image files with the script unless you make a backup first, until you are sure the script handles your chosen options properly. I think I have fixed it, but early versions of the script were accidentally over-writing and essentially erasing the original image file, so beware! I have not built making backup copies into the script as it could, on some systems, magnify the problems of limited memory which it was designed to resolve.
In fact, trying to run it on my sl6000,
"crop.sh" crashes with a
Segmentation Fault, so I think the script is unlikely to ever function properly unless is is run via ssh to a host box. Make sure to make backup copies of important images if you have installed ImageMagick on your Zaurus and decide to play with this script on the Z instead of remotely.
"crop.sh" requires that the
"convert" commands have already been installed, through ImageMagick, on the host box. I have tested it using the ImageMagick Version:6.2.8 04/05/07 versions of
"convert". More information about these commands can be obtained at
You can obtain a copy of the most recent version of
"crop.sh" from http://www.sdjf.esmartdesign.com/files/crop.sh, or get a copy of the first public version here. The newest version adds more built in proportions and has bug fixes, but I am making the earlier version available in case anyone likes it better.
I am only testing combinations of options as I need them, so if you find a combination that does not give you the desired results when running it via ssh, save a copy of all command line and image input and output, and contact me, and I will do my best to fix it.
Here is the usage for
"crop.sh," as generated by the script when entered without any arguments:
ERROR: no arguments given
Usage: crop.sh [location] [amount] file
file: full filename for input file
I have also written a companion script called
"split", which depends on
"crop.sh" and will automatically generate a complete set of horizontal slices of an image if I want to view the whole thing in pieces. At this point, since it was written to view handwritten or typewritten data files, it allows some overlap and will not cut an image into precise halves, thirds, etc.
If you want to get precisely cropped pieces, the percentages defined in
"crop.sh" would need to be hacked. You can obtain a copy of
"split" is as follows:
Usage: split [amount] file
file: full filename for input file
For example, to split "
firstimage.tiff" into four horizontal slices, I would enter the following command:
./split four firstimage.tiff
Again, I need to warn you that
crop.sh was written to be run on a full Linux operating system so the resulting smaller files can be downloaded to your Zaurus. I do not think it will work properly on the Zaurus, especially those with
ROMs, at least in part because of the massive memory requirements. But if you need to somehow get cropped images to view on your Zaurus and cannot get your hands on a GUI image editor that does what you need, I have found it an invaluable tool to use via ssh, and hope you will also find it helpful.
Revised December 18, 2011