Yes i can see the image file created in "/var/www/html/images" correctly
My php file is located in "/var/www/html/" folder
here the complete code i use:
I have the same problem
My php file is located in "/var/www/html/" folder
here the complete code i use:
PHP:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$login = 'admin';
$password = 'password';
$url = 'http://Cam_IP/cgi-bin/snapshot.cgi';
header("Content-type: image/jpg");
header ("Content-type: image/jpeg");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
$result = curl_exec($ch);
curl_close($ch);
$im = imagecreatefromstring($result);
$now = date("d-m-Y-H:i");
$newnew = imagecreatetruecolor(960,540);
imagecopyresized($newnew, $im, 0, 0, 0, 0, 960, 540, 1920, 1080);
$newnewfile = "images/$now-r.jpg";
imagejpeg($newnew, $newnewfile);
imagedestroy($im);
imagedestroy($newnew);
?>
<!DOCTYPE html>
<HTML>
<HEAD>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
<TITLE>Test Cam SnapShot</TITLE>
</HEAD>
<BODY>
<img src="<?php echo "<img src=\"images/$now-r.jpg\">"; ?>" alt=""/>
</BODY>
</HTML>
I have the same problem