Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function _parsepng($file) {
- // Extract info from a PNG file
- $fopen = false;
- if ($fopen){
- $f = fopen($file, 'rb');
- if (!$f)
- $this->Error('Can't open image file: ' . $file);
- $info = $this->_parsepngstream($f, $file);
- fclose($f);
- return $info;
- } else {
- $f = fopen('php://temp', 'w+');
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $file);
- curl_setopt($ch, CURLOPT_FILE, $f);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
- //curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
- //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- //curl_setopt($ch, CURLOPT_POSTFIELDS,[]);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_exec($ch);
- if (!$f)
- $this->Error('Can't open image file: ' . $file);
- $info = $this->_parsepngstream($f, $file);
- curl_close($ch);
- return $info;
- }
- }
Add Comment
Please, Sign In to add comment