0 votes

As to save a copy of an image to use library gd php

I need to save 2 images one edited and the other unedited. to edit my image with imagecreatefromjpeg($img); I would like to save it in the same directory with another name to have the 2 images. The edited and the original.


Jose Javier Segura Points 1578

I would recommend you hicieses in two steps:

1.- Save the image that you uploaded in the folder that you want to

copy($_FILES['txtfile']['tmp_name'], $dirdestino);

2.- Then with the GD library, to save the image retouched

imagecopyresampled($imagen_nueva, $imagen_vieja, 0, 0, 0, 0,$nuevo_ancho, $nuevo_alto, $ancho, $alto);

If you put the code that you have, perhaps it might also be easier to help you


HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by: