Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to return the absolute url
    primarykey
    data
    text
    <p>I've been trying to insert an image inside a php generated image (using imagecreatefromX() where x = gif, jpeg, or png) using a GET perimeter as the source url. I try to have it check what MIME type it is, by doing this:</p> <pre><code>$pic = $_GET['pic']; switch(returnMIMEType($pic)) { case "image/gif": $profileImage = @imagecreatefromgif($pic) or die('Unable to load gif image.'); break; case "image/jpg": $profileImage = @imagecreatefromjpeg($pic) or die('Unable to load jpeg image.'); break; case "image/png": $profileImage = @imagecreatefrompng($pic) or die('Unable to load png image.'); break; default: $pic = 'http://www.example.com/image.gif'; $profileImage = @imagecreatefromgif($pic) or die('Unable to load gif image.'); break; } $profileImageWidth = imagesx($profileImage); $profileImageHeight = imagesy($profileImage); imagecopyresized($image, $profileImage, 0, 0, 0, 0, 25, 25, $profileImageWidth, $profileImageHeight); </code></pre> <p>returnMIMEType() is just a simple function I came up with to return the MIME type. </p> <p>When a url is given in this format: "http://graph.facebook.com/123456789/picture", it should return with a jpg image of the users profile picture on Facebook, but I'm assuming, and which is what I'm having issues with, is PHP is looking at that exact URL and not the url "http://graph.facebook.com/123456789/picture" redirects too. How would I have it so it understands to wait until the redirect?</p> <p>Thank you for your consideration in this matter!</p> <p><strong>Here is the error it gives:</strong></p> <pre><code>Warning: mime_content_type() [function.mime-content-type]: File or path not found 'http://graph.facebook.com/123456789/picture' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload