note 11401 deleted from function.imagecreatefromjpeg by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:13:22 +0000 |
| Subject: | note 11401 deleted from function.imagecreatefromjpeg by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208499@lists.php.net to get a copy of this message | ||
Note Submitter: mboucher at ampmedia dot net
----
In response to my own post:
Maybe this is common knowledge but here is how I solved my problem. Hopefully this will help out
seeing how I couldn't find any other articles on this topic with a solution.
This seems to work pretty well. Displays in browser and QT Picture Viewer but for some reason
Photoshop won't open it. Translation error. Since I'm just using it to cache the image for
when the our content provider goes down no biggie there.
<?php
$si = fopen($imagePathURL, "r"); // open URL
$serverImg = fread($si, 1000000); // read contents
fclose($si); // close file
?>
/* open file to save to (w+ creates if file does not exist || b opens binary safe [Win32]) Seemed to
work fine with out the 'b' on Windows NT but just to be safe. */
<?php
$si = fopen($saveImgTo, "w+b");
fwrite($si, $serverImg); // write contents to file
fclose($si); // close file
?>
Hope this helps somebody...long live PHP