Can't show image with GD library PHP

124 Views Asked by At

I'm trying to display an image from another server with the code below

<?php
header("Content-type: image/png");

$string = $_GET['text'];
$im = imagecreatefrompng("https://i.imgur.com/aAnTsd8.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);

imagedestroy($im);
?>

The above code works fine, but when I change the URL of the image to another URL, example that I put below, the code does not display the image.

https://www.wordapp.com/wpsite/wp-content/uploads/2017/01/google-ranking-factors.png

Does anyone know the reason for displaying one image and not displaying the other?

Thank you

0

There are 0 best solutions below