Viewing 1 replies (of 1 total)
  • Thread Starter ahering

    (@ahering)

    Finally found a solution, posting it here just in case someone runs into the same issue, I have replaced the getimageresize() with this function:

    function getimgsize($url, $referer = ”)
    {
    $headers = array(
    ‘Range: bytes=0-32768’
    );

    /* Hint: you could extract the referer from the url */
    if (!empty($referer)) array_push($headers, ‘Referer: ‘.$referer);

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($curl);
    curl_close($curl);

    $image = imagecreatefromstring($data);

    $return = array(imagesx($image), imagesy($image));

    imagedestroy($image);

    return $return;
    }

Viewing 1 replies (of 1 total)

The topic ‘CM AD Changer’ is closed to new replies.