Skip to content

Instantly share code, notes, and snippets.

View otahirs's full-sized avatar

Otakar Hirš otahirs

View GitHub Profile
@pqina
pqina / create-thumbnail.php
Last active June 29, 2023 18:13
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