mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-28 22:33:11 +00:00
Lower resolution image preview
This commit is contained in:
parent
3847020ae7
commit
41d98a7d47
8 changed files with 190 additions and 84 deletions
20
app/format/create_thumbnail.php
Normal file
20
app/format/create_thumbnail.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| Create Thumbnails
|
||||
|-------------------------------------------------------------
|
||||
| Default resolution for a preview image is 300px (max-width)
|
||||
| ** Not yet implemented **
|
||||
|-------------------------------------------------------------
|
||||
*/
|
||||
function make_thumbnail($image_path, $thumbnail_path, $resolution) {
|
||||
try {
|
||||
$thumbnail = new Imagick($image_path);
|
||||
$thumbnail->resizeImage($resolution,null,null,1,null);
|
||||
$thumbnail->writeImage($thumbnail_path);
|
||||
|
||||
return "success";
|
||||
} catch (Exception $e) {
|
||||
return $e;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue