Tiny Core Extensions > TCE News

PicFormat extension submitted

(1/4) > >>

Rich:
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:

--- Code: ---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.
--- End code ---

imlib2  does not provide a mechanism to list which image formats it can load or save. I wrote a small script to list them:

--- Code: ---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$
--- End code ---
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:

--- Code: ---tar xf PicFormat-source-v0.20.tar.gz
cd PicFormat
./CompilePicFormat
--- End code ---

When it completes, copy  PicFormat.tcz, PicFormat.tcz.dep, and PicFormat.tcz.md5.txt  to your  tce/optional  directory. Then:

--- Code: ---tce-load -i PicFormat
--- End code ---

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:

--- Quote ---Attached is PicFormat for TC12.
PicFormat-armv.tar.gz.bfe contains the extension and the source tarball.
--- End quote ---
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#submitting
Use the  tcesubmit  email address, not the  picoresubmit  address.

rullolex:
Hi Rich,

I'm interested to use PicFormat, looking via Apps browser I do not find it. (TC12)

Where I can download it?

Thanks

Rich:
Hi rullolex
It is present in both TC 12 repositories:
http://tinycorelinux.net/12.x/x86/tcz/PicFormat.tcz.info
http://tinycorelinux.net/12.x/x86_64/tcz/PicFormat.tcz.info

What happens if you execute this:

--- Code: ---tce-load -wi PicFormat
--- End code ---

rullolex:
Hi Rich,

Downloaded and loaded.

I confirm that PicFormat works with TC12 x86.

Ps.:sorry I forgot the time zone.

Rich:
Hi rullolex

--- Quote from: rullolex on March 28, 2021, 08:07:13 AM --- ... I confirm that PicFormat works with TC12 x86. ...
--- End quote ---
Thank you for testing.

Navigation

[0] Message Index

[#] Next page

Go to full version