I was able to set the fixed size for the image (500x500) now I wanted to know if you have how to get this image already defined and put another with imagecopymerge?
<?php
$img = $_POST['img'];
$user = imagecreatefromjpeg($img);
$mask = imagecreatefromgif('imgs/logo.gif');
$width = 500;
$height = 500;
$image_p = imagecreatetruecolor($width, $height);
list($width_orig, $height_orig) = getimagesize($img);
$ratio_orig = $width_orig/$height_orig;
if ($width/$height > $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}
$imagem = imagecopymerge($user, $mask, 0,0,0,0,500,500,50);
imagecopyresampled($image_p, $user, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
header('Content-Type: image/png');
imagepng($image_p);
?>