Skip to content

Instantly share code, notes, and snippets.

View programmerlab's full-sized avatar

kundan roy programmerlab

View GitHub Profile
@programmerlab
programmerlab / create-thumbnail.php
Created March 20, 2018 06:53 — forked from pqina/create-thumbnail.php
Create thumbnails with PHP
<?
// Link image type to correct image loader and saver
// - makes it easier to add additional types later on
// - makes the function easier to read
const IMAGE_HANDLERS = [
IMAGETYPE_JPEG => [
'load' => 'imagecreatefromjpeg',
'save' => 'imagejpeg',
'quality' => 100