imagecreatefromjpeg does not show image in PHP

0

Hi, I have a .php page with the following code:

<?php

        header('Content-Type: image/jpeg');

        $im_orig=imagecreatefromjpeg("https://drupal-multisite-s3.s3-us-west-2.amazonaws.com/files/universo.1.jpg");
        $im_dest=imagecreatefromjpeg("https://www.jpl.nasa.gov/spaceimages/images/wallpaper/PIA09579-800x600.jpg");
        $im_dest_x=110;
        $im_dest_y=60;
        $im_orig_x=0;
        $im_orig_y=0;
        $im_orig_w=240;
        $im_orig_h=180;
        $im_orig_nw=100;
        $im_orig_nh=75;

        imagecopyresampled($im_dest, $im_orig, $im_dest_x, $im_dest_y, $im_orig_x, $im_orig_y, $im_orig_w, $im_orig_h, $im_orig_nw, $im_orig_nh);

        imagejpeg($im_dest);
        imagedestroy($im_dest);
        imagedestroy($im_orig);

    ?>

But when loading the page, it only shows me a small white square with a gray background. I inspect the element, and even if I create the label it puts me as src " link " which is the folder where I have my php file. I have tried using images that are in the same folder as my file, for example

$im_orig=imagecreatefromjpeg("original.jpg");
$im_dest=imagecreatefromjpeg("destino.jpg");

But the result is the same, white square with gray background and the source pointing to the folder where the files are.

Thanks in advance.

    
asked by Lucas. D 16.05.2017 в 22:11
source

0 answers