I am trying to simply show an image with code bellow:
<?php
$plik = 'test.JPG';
header('Content-Type: image/jpeg');
$percent = 0.1;
list($width, $height) = getimagesize($plik);
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($plik);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, NULL, 70);
imagedestroy($image_p); ?>
unfortunetlly instead of image I can see only black screen with small sqare inside.
- The file test.JPG exist and it is inside the same catolgue with file obraz.php which consist only code above.
- I'm running it on Chrome.
- PHP Version 5.2.11
- GD Version bundled (2.0.34 compatible)
Any clue what can I do to fix it?