0

I am trying to copy a resampled image. Something seems not working:

copy($_FILES['image']['name'],'logo.png');
$dir_subida = 'C:\xampp5\htdocs\bild';
$source = imagecreatefrompng($_FILES['image']['name']);
$destination = imagecreatefrompng($dir_subida . '\\logo.png');
imagecopyresampled($destination,$source,0,0,0,0,110,55,600,220);

First I copy the image and save it in a directory. Then, I define the source (an image that I am uploading in a form). Then I define the destination.

Then I try to resample and copy it with the default function imagecopyresampled.

It just copies the image right away without any kind of changes.

Am I missing something?

prgrm
  • 3,734
  • 14
  • 40
  • 80
  • 3
    When you ask a question about an error, **ALWAYS** post the error log. To enable error reporting to your php code, append `error_reporting(E_ALL); ini_set('display_errors', '1');` at the top of your script, what does it return ? – Pedro Lobito May 09 '16 at 13:24

1 Answers1

1

You must save the destination image to a file after you manipulate it.

imagepng($destination, 'c:\\path\\to\\file.png');
Bartosz Zasada
  • 3,762
  • 2
  • 19
  • 25