PHP Classes

File: examples/crop.php

Recommend this page to a friend!
  Classes of Jose Luis Quintana   GImage   examples/crop.php   Download  
File: examples/crop.php
Role: Example script
Content type: text/plain
Description: Example script
Class: GImage
Create graphic images with a fluent interface
Author: By
Last change: docs: improve example pages and code files
refactor: minor project docs updates
Date: 8 months ago
Size: 669 bytes


Class file image Download
 * This file is part of GImage.
 * (c) Jose Quintana <>
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.

 * Cropping an image.
 * @author Jose Quintana <>

namespace GImage\Examples;


__DIR__ . '/_config.php';
__DIR__ . '/../tests/bootstrap.php';

$image = new Image();
// Load an image (500px x 500px)
// Resize and crop in the middle (100px x 60px)
->centerCrop(100, 60)
// Save the resource
->save(__DIR__ . '/crop.jpg');