|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-10 20:09 UTC] sniper@php.net
[2001-11-12 06:40 UTC] S dot G dot Spencer at warwick dot ac dot uk
[2001-11-18 19:10 UTC] sniper@php.net
[2001-12-13 06:28 UTC] sander@php.net
[2002-07-27 12:03 UTC] midg3t at mail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 04:00:01 2025 UTC |
The following code should give me the image served by my webcam server: $cam = ImageCreateFromJPEG('http://localhost:69/'); imagejpeg($cam); But instead gives me: Warning: imagecreatefromjpeg: Unable to open 'http://localhost:69/' for reading in c:\program files\apache\htdocs\webcam\cam.php If, however, I create a local copy of the output of the server, like this: $in = fopen('http://localhost:69/','rb'); $out = fopen('tempcam.jpg','wb'); while ( !feof($in) ) { $temp = fread ($in, 4096); fwrite($out,$temp); } fclose ($in); fclose($out); and then use ImageCreateFromJPEG on that file instead of the URL, it works perfectly. Therefore, ImageCreateFromJPEG doesn't re-use the fopen code correctly (as it should and is hinted to by the manual page saying that ImageCreateFromJPEG can open files or URLs). Bug 6825 seems to be similar, but for PHP 4.0.2. The bug was closed as it was allegedly fixed, but now seems to have re-surfaced.