mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Better handling for images
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$url = file_get_contents("https://img.youtube.com/vi/" . $_POST['id'] . "/mqdefault.jpg");
|
||||
$url = file_get_contents("https://img.youtube.com/vi/".$_POST['id']."/mqdefault.jpg");
|
||||
|
||||
$image = new Imagick();
|
||||
$image->readImageBlob($url);
|
||||
@@ -10,9 +10,9 @@ $image->blurImage(30,50);
|
||||
|
||||
$output = $image->getimageblob();
|
||||
|
||||
//$image->setImageFormat("jpeg");
|
||||
$image->setImageFormat("jpeg");
|
||||
|
||||
//$image->imageWriteFile (fopen ("/static/images/thumbnails/".$_POST['id'].".jpg", "wb"));
|
||||
file_put_contents ("../static/images/thumbnails/".$_POST['id'].".jpg", $image);
|
||||
|
||||
echo base64_encode($output);
|
||||
?>
|
||||
Reference in New Issue
Block a user