I recently wanted to reduce some pictures prior to emailing them from 3264 x 2448 to 800 x 600. Looking in the
repository I only found ImageMagick and GraphicsMagick, both of which were a lot more than I was looking for. I just
wanted a small simple command line utility that doesn't require X, so I wrote one. Its only dependency is imlib2.tcz.
If you are running Xorg or Xvesa then imlib2.tcz is already installed.
PicFormat is about 4600 bytes. Running it with no parameters produces this help screen:
PicFormat version 0.10 Mar 27 2021 17:03:29
Copyright Richard A. Rost Mar 17,2021
PicFormat performs simple image manipulation such as
resizing, rotating, and format change (i.e. .jpg to .png).
Usage: PicFormat [-i FILE] [-o FILE] [-w N] [-h N] [-r N]
-i FILE Input image.
-o FILE Output image.
-w N Output width in pixels.
-h N Output height in pixels.
-r N Rotate image CW 90, 180, or 270 degrees.
Notes
Only -w OR -h is needed if resizing.
If rotating 90 or 270, -w and -h are swapped.
imlib2 does not provide a mechanism to list which image formats it can load or save. I wrote a small script to list them:
tc@E310:~/C_Programs/PicFormat$ ./PicFormats.sh
argb.so load save
bmp.so load save
bz2.so load
ff.so load save
gif.so load
jpeg.so load save
lbm.so load
png.so load save
pnm.so load save
tga.so load save
tiff.so load save
xpm.so load
zlib.so load
tc@E310:~/C_Programs/PicFormat$
It requires one of these optional dependencies, binutils.tcz or elfutils.tcz.
The x86 and x86_64 versions were built under TC10. The x86 executable was also tested under TC4. The x86_64
executable was also tested under TC11. In addition, since imlib2 is unchanged in TC10 through TC12, I feel confident
PicFormat will run under all those versions and has been added to those repositories.
If someone wants to build it for piCore, piCore 11 and piCore 12 both have imlib2 available. The source package is here:
http://tinycorelinux.net/10.x/x86/tcz/src/PicFormat/To build it:
tar xf PicFormat-source-v0.20.tar.gz
cd PicFormat
./CompilePicFormat
When it completes, copy PicFormat.tcz, PicFormat.tcz.dep, and PicFormat.tcz.md5.txt to your tce/optional directory. Then:
tce-load -i PicFormat
You will also find a PicFormat-armv.tar.gz.bfe or PicFormat-aarch64.tar.gz.bfe file has been created. It contains
all the extension files and a source package.
Now you can submit it to the repository. Attach the PicFormat file with the .bfe extension it to a brief email that says:
Attached is PicFormat for TC12.
PicFormat-armv.tar.gz.bfe contains the extension and the source tarball.
Adjust the TC version and filename as required.
The instructions for emailing the extension are here:
http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submittingUse the tcesubmit email address, not the picoresubmit address.