Coder Social home page Coder Social logo

jjpeleato / php-gd-image-processing Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 283 KB

Create and manipulate image files with PHP and the GD library of images.

License: GNU General Public License v2.0

JavaScript 21.42% CSS 22.70% HTML 13.89% PHP 41.99%
gd-library php

php-gd-image-processing's Introduction

PHP and GD library

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.

Installing dependencies

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:

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/).

Project skeleton

├─ 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

Installing

  1. Open your terminal and browse to the root location of your project.
  2. 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.
  3. If required. Run: $lando composer install
  4. If required. Run: $lando npm install --save-dev or $lando yarn install --dev
  5. End. Happy developing.

Developing with NPM or Yarn and Gulp.

  • 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

Technologies and tools

The present project uses several technologies and tools for the automation and development process. For more information and learning visit the following links.

  1. GD Library: https://www.php.net/manual/en/book.image.php
  2. Git: https://git-scm.com/
  3. Lando: https://docs.devwithlando.io/
  4. Composer: https://getcomposer.org/
  5. NPM: https://www.npmjs.com/
  6. Yarn: https://yarnpkg.com/
  7. Sass: https://sass-lang.com/
  8. Gulp: https://gulpjs.com/
  9. Babel: https://babeljs.io/
  10. EditorConfig: https://editorconfig.org/
  11. Stylelint: https://stylelint.io/
  12. Jshint: https://jshint.com/
  13. Human.txt: http://humanstxt.org/

Note: Thanks a lot of developers that to work on this projects.

Others clarifications

  1. 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.

Finally

More information on the following commits. If required.

Grettings @jjpeleato.

php-gd-image-processing's People

Contributors

jjpeleato avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.