Skip to content

Instantly share code, notes, and snippets.

Avatar

pqina pqina

View GitHub Profile
@pqina
pqina / create-thumbnail.php
Last active Apr 11, 2021
Create thumbnails with PHP
View create-thumbnail.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