Project: GD Process
Description: A CLI image file manipulation script.
Author: John Walsh
Maintainer: John Walsh
Copyright (C) 2021, John Walsh, all rights reserved.
Created: May 05 2021
https://sourceforge.net/projects/gd-process/
----
This is 'GD Process'.
It is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
There should be a copy of the GNU General Public License
in the file 'COPYING'. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------
Change Log / Development History
================================
Version: 1.2.0 - 12/05/2021
Added 'dry' option.
Updated the help text.
Version: 1.1.0 - 08/05/2021
Added 'mirror' option.
Version: 1.0.0 - 03/05/2021
First release.
----------------------------------------------------------------------
Description
===========
A CLI image file manipulation script, based on the PHP GD library.
It was inspired by the 'convert' utility that is provided with
ImageMagic.
It is designed to be a CLI script that provides some basic image file
manipulations.
I wrote it to support the ghost ball image processing for my pool tips
project, see:
https://sourceforge.net/projects/jdw-pool-tips/
It also required the development of an argv[] processing support script,
hence the project:
https://sourceforge.net/projects/jdw-argv/
Requirements :-
1) PHP with the GD library
https://www.php.net/
2) jdw_argv.php
https://sourceforge.net/projects/jdw-argv/
gd_process.php can perform these image file manipulations :-
none - so it can be used to convert image file types
create
scale
crop
mirror
rotate
merge
adjoin
PHP can only work with image file types (by extension) :-
jpg, jpeg
gif
png
bmp
gd_process.php can work on a single file, or a 'glob' of files
within a dir.
----------------------------------------------------------------------
Howto Install
=============
1) unzip the file, then you should have:
gd_process.php
jdw_gd_sup.php
jdw_argv.php
jdw_sup.php
2) make sure 'gd_process.php' is executable
3) link (or copy) 'gd_process.php' into your: /usr/local/bin
I use a link, and it works fine.
eg. if you downloaded and have your fies in: /home/user/my_utils
then, as root, you would do:
cd /home/user/my_utils
chmod 755 gd_process.php
cd /usr/local/bin
ln -s /home/user/my_utils/gd_process.php .
3) run it to get the help:
gd_process.php -h
----------------------------------------------------------------------
Usage
=====
examples and testing argv[] processing :-
gd_process.php - --debug-level 30 -d -d -d0 -h
gd_process.php --create ./new.jpg --bbox1=0x0x50x50 --bg=8080ff
gd_process.php -d ./new.jpg --output .png
gd_process.php --create ./new.jpg --bbox1=0x0x50x50 --bg=8080ff --output ./new2.jpg -d -d
gd_process.php --debug-level=30 ./new2.jpg --scale --crop --adjoin -h
gd_process.php --debug-level=30 ./new2.jpg --scale --crop --adjoint -h
gd_process.php ./new.jpg --rotate --angle=10 --bg=ff0000 --output rotate1.jpg
gd_process.php ./rotate1.jpg --rotate --angle=10 --bg=00ff00 --output rotate2.jpg
gd_process.php ./rotate2.jpg --rotate --angle=10 --bg=0000ff --output rotate3.jpg -d -d
gd_process.php ./rotate3.jpg --scale --axis=x --size=100 --output scale1.jpg
gd_process.php ./rotate3.jpg --scale --axis=x --size=1024 --output scale2.jpg
gd_process.php ./scale1.jpg --output=crop.jpg --crop -i --bbox1=0x0x50x50
gd_process.php --create ./new3.jpg --bbox1=0x0x256x256 --bg=000000
gd_process.php --create ./new4.jpg --bbox1=0x0x128x128 --bg=ffffff
gd_process.php --merge ./new3.jpg ./new4.jpg -i --at=50%x50% --bbox2=0x0x100%x100% --percent=100 --output=square.jpg -d
gd_process.php --merge ./scale2.jpg ./square.jpg -i --at=100x100 --bbox2=0x0x100%x100% --percent=100 --output=merge1.jpg -d -d
gd_process.php --merge ./merge1.jpg ./square.jpg -i --at=-100x-100 --bbox2=0x0x100%x100% --percent=50 --output=merge2.jpg -d -d
gd_process.php --adjoin --bg=ffff00 ./merge2.jpg ./scale1.jpg --output=./adjoin1.jpg -d -i --axis=x --at=-100
gd_process.php --adjoin --bg=00ffff ./merge2.jpg ./scale1.jpg --output=./adjoin2.jpg -d -i --axis=y --at=50% -d -d
gd_process.php --mirror --axis=y ./adjoin1.jpg --output=./mirror1.jpg -d -d
gd_process.php --mirror --axis=x ./adjoin2.jpg --output=./mirror2.jpg -d -d
gd_process.php -d ./\*.jpg --output .png
gd_process.php ./\*.png --scale --size=50% -d -d --dry
rm *.{jpg,jpeg,gif,png,bmp}
----
wildcard'ing filenames (globbing)
gd_process.php ./\*.\{gif,png,bmp\} --output=.jpg -d -d
----------------------------------------------------------------------
To Do
=====
----------------------------------------------------------------------