Create and manipulate image files with PHP and the GD library of images.
PHP is not limited to creating just HTML output. It can also be used to create and manipulate image files in a variety of different image formats, including GIF, PNG, JPEG, WBMP, and XPM. Even more conveniently, PHP can output image streams directly to a browser. You will need to compile PHP with the GD library of image functions for this to work.
You can read more at the following link: https://www.php.net/manual/en/book.image.php
The main file is: public/src/core/GdGraphicsLibrary.php
This file is an example that uses the image processing with GD library.
- You have to install Lando: https://docs.devwithlando.io/
If Lando's tools does not work for you, there is another way. You must install the environment manually: XAMP, Composer, Node.JS, NPM or Yarn and Gulp CLI.
For more information visit:
- XAMP: https://www.apachefriends.org/es/index.html
- Composer: https://getcomposer.org/
- Node and NPM: https://nodejs.org/es/
- Yarn: https://yarnpkg.com/es-ES/
- Gulp: https://gulpjs.com/
Note: If you work with Windows. To execute the commands, we recommend installing Cygwin http://www.cygwin.com/
Note: I recommend installing the following IDE for PHP Programming: Visual Studio Code (https://code.visualstudio.com/) or PHPStorm (recommended) (https://www.jetbrains.com/phpstorm/).
├─ assets/ # Front-end directory
│ ├─ fonts/
│ ├─ img/
│ ├─ js/
│ ├─ scss/
│ ├─ .htaccess.dist
│ └─ .htpasswd.dist
├─ gulp/
│ ├─ task/
│ └─ config.js # Paths and configuration Gulp system.
├─ private/
│ ├─ config/ # Environment configuration
│ └─ .htaccess
├─ public/ # Public directory
│ ├─ src/ # Source directory
│ │ └─ core/
│ │ └─ GdGraphicsLibrary.php # Main file
│ ├─ upload/ # Uploading directory
│ ├─ browserconfig.xml
│ ├─ index.html
│ ├─ manifest.json
│ └─ phpinfo.php
├─ .babelrc
├─ .editorconfig
├─ .gitignore
├─ .jshintignore
├─ .jshintrc
├─ .lando.yml
├─ .stylelintignore
├─ .stylelintrc
├─ composer.json
├─ gulpfile.babel.js
├─ LICENSE
├─ package.json
└─ README.md
- Open your terminal and browse to the root location of your project.
- Run
$lando start
.- The project has a .lando.yml file with all the environment settings.
- The command starts the installation process when it finishes, you can see all the URLs to access.
- If required. Run:
$lando composer install
- If required. Run:
$lando npm install --save-dev
or$lando yarn install --dev
- End. Happy developing.
- Open your terminal and browse to the root location of your project.
- If required. Run:
$lando npm install --save-dev
or$lando yarn install --dev
then:$lando gulp [action]
- To work with and compile your Sass and JS files on the fly start:
$lando gulp
- Gulp actions commands list:
$lando gulp clean
Delete all files.$lando gulp css
Compile SASS to CSS and validate SASS according Stylelint (https://stylelint.io/). Not concat.$lando gulp cssAssets
Copy CSS assets to public directory.$lando gulp cssWithConcat
Concat and compile SASS to CSS and validate SASS according Stylelint (https://stylelint.io/).$lando gulp fontAssets
Copy fonts assets to public directory.$lando gulp images
Copy and minify PNG, JPEG, GIF and SVG images with imagemin.$lando gulp imagesAssets
Copy and minify PNG, JPEG, GIF and SVG assets images with imagemin.$lando gulp js
Validate the code with JSHint. Minify the JS files.$lando gulp jsAssets
Copy JS assets to public directory.$lando gulp jsWithConcat
Validate the code with Jshint. Concat and minify the JS files.$lando gulp validateJs
Validate JS with JSHint (https://jshint.com/).$lando gulp validateScss
Validate SCSS according Stylint (https://stylelint.io/).$lando gulp watch
Compile SASS to CSS and concat and minify JS files in real-time.
- NPM actions commands list:
$lando npm run gulp:dev
Compile for development environment$lando npm run gulp:prod
Compile for production environment
The present project uses several technologies and tools for the automation and development process. For more information and learning visit the following links.
- GD Library: https://www.php.net/manual/en/book.image.php
- Git: https://git-scm.com/
- Lando: https://docs.devwithlando.io/
- Composer: https://getcomposer.org/
- NPM: https://www.npmjs.com/
- Yarn: https://yarnpkg.com/
- Sass: https://sass-lang.com/
- Gulp: https://gulpjs.com/
- Babel: https://babeljs.io/
- EditorConfig: https://editorconfig.org/
- Stylelint: https://stylelint.io/
- Jshint: https://jshint.com/
- Human.txt: http://humanstxt.org/
Note: Thanks a lot of developers that to work on this projects.
- It is possible that on Mac OS the Gulp tasks do not run the correct form. In this case install NodeJS, NPM and Gulp-cli in your OS and execute the tasks outside the Docker containers.
More information on the following commits. If required.
Grettings @jjpeleato.