Jump to content
php.lv forumi

Augšuplādēt gif bildes


shurix

Recommended Posts

Kā droši atļaut augšupielādēt gif bildes lietotājiem. Zinu ka jpg un png bildes, lai uzlabotu drošību pēc augšupielādes pārveido ar imagecopyresampled, bet ko darīt ar gif bildēm? Varbūt kādam ir neliels scripts, ar kuru var augšupielādēt gif bildes?

Link to comment
Share on other sites

Mans kods apmēram šāds, bet uploadojot gifu viņš ir nekustīgs.

$source_image = imagecreatefromgif($file['tmp_name']);
$dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);
imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $dest_imagex, $dest_imagey, $source_imagex, $source_imagey);
$image_name = $name.'.gif';
$newname = "images/".$folders."/".$image_name;
imagegif($dest_image, $newname);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...