title: PHP black screen instead of image
body: <p>I am trying to simply show an image with code bellow:</p>
  
  <pre><code>&lt;?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); ?&gt; 
  </code></pre>
  
  <p>unfortunetlly instead of image I can see only black screen with small sqare inside.
  <a href="https://i.stack.imgur.com/hUWfY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hUWfY.png" alt="enter image description here"></a></p>
  
  <ol>
  <li>The file test.JPG exist and it is inside the same catolgue with file obraz.php which consist only code above.</li>
  <li>I'm running it on Chrome.</li>
  <li>PHP Version 5.2.11</li>
  <li>GD Version  bundled (2.0.34 compatible)</li>
  </ol>
  
  <p>Any clue what can I do to fix it?</p>