Hello, in general, there is a function to save jpg images
if(exif_imagetype($tmp) == IMAGETYPE_JPEG) { $image = imagecreatefromjpeg($tmp); $path = $this->createdir().$name.'.jpg'; imagejpeg($image, $this->cdndir.$path, 100); imagedestroy($image); } and here is the same, but for gif
if(exif_imagetype($tmp) == IMAGETYPE_GIF && $this->gif) { header("Content-Type: image/gif"); $image = imagecreatefromgif($tmp); $path = $this->createdir().$name.'.gif'; imagegif($image, $this->cdndir.$path); imagedestroy($image); } but the fact is that when saving, the picture then has the .gif extension and type, but the animation completely disappears and it becomes static, do not tell me what kind of nonsense? no nerves anymore