Skip to content

Instantly share code, notes, and snippets.

@Djuki
Last active September 8, 2015 15:19
Show Gist options
  • Save Djuki/7209e9320415c0601fe2 to your computer and use it in GitHub Desktop.
Save Djuki/7209e9320415c0601fe2 to your computer and use it in GitHub Desktop.
PHP Mentoring Tasks

Resizing library

This task is created for apprentices who want to learn about OOP

Create PHP library which will resize the images.

For cropping images we will use library "image-workshop" - https://packagist.org/packages/sybio/image-workshop

Library need to support several types of resizing

  • Exact: Resize to exact width and height. Aspect ratio will not be maintained
  • Auto: The best strategy (portrait or landscape) will be selected for a given image according to its aspect ratio
  • Crop: This option will crop your images to the exact size you specify with no distortion
  • Square: This strategy will first crop the image by its shorter dimension to make it a square, then resize it to the specified size

In this first part of the task is widely open to any kind of implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment