When I use function getimagesize
or imagecreatefromjpeg
for a link in my app it send me an error:
getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known
Here is my code:
// tidy up by removing temporary image
unlink($tempname);
return $retvars;
}
/**
* Extract info from a JPEG file without using the GD library.
* @param $file (string) image file to parse
* @return array structure containing the image data
* @public static
*/
public static function _parsejpeg($file) {
$a = getimagesize($file);
if (empty($a)) {
//Missing or incorrect image file
return false;
}
if ($a[2] != 2) {
// Not a JPEG file
return false;
}
// bits per pixel
$bpc = isset($a['bits']) ? intval($a['bits']) : 8;
// number of image channels
if (!isset($a['channels'])) {
Exactly when i copy the link of image in my address bar it appear and it exist. My PHP version is 5.3.3.