Bars
Новичок
Тупо ничего не выводится, даже error_reporting(E_ALL); ничего не показывает. В чём проблема?
PHP:
<?php
$url = $_GET['url'];
if (strpos($url, 'scontent.cdninstagram.com') == false || strpos($url, 't51.2885-15') == false) echo 'Access Denied!';
$src = imagecreatefromjpeg($url);
$oldW = imagesx($src);
$oldH = imagesy($src);
// Даже с этим:
// $newW = $oldW, $newH = $oldH;
// $max_width = 640, $max_height = 640;
if ($oldW < $oldH) {
$newW = $oldW * ($max_width / $oldH);
$newH = $max_height;
} else {
$newW = $max_width;
$newH = $oldH * ($max_height / $oldW);
}
$new = imagecreatetruecolor($newW, $newH);
imagecopyresampled($new, $src, 0, 0, 0, 0, $newW, $newH, $oldW, $oldH);
header('Content-Type: image/jpeg');
imagejpeg($new);
imagedestroy($new);
imagedestroy($src);
?>