Team Insane Esport.eu Index du Forum
Team Insane Esport.eu
Forum de la Team Insane Esport.eu ; La vrais Insane recrée cette année pour parcourir les podiums en match a mort normal et en R&D normal !
 
Team Insane Esport.eu Index du ForumFAQRechercherS’enregistrerConnexion

:: Class Image Resize Php Download Windows ::

 
Poster un nouveau sujet   Répondre au sujet    Team Insane Esport.eu Index du Forum -> Team -> Recherche et Destructions normal
Sujet précédent :: Sujet suivant  
Auteur Message
ambrojanis


Hors ligne

Inscrit le: 10 Avr 2016
Messages: 133
Localisation: Montpellier

MessagePosté le: Ven 21 Oct - 14:12 (2016)    Sujet du message: Class Image Resize Php Download Windows Répondre en citant




Class Image Resize Php Download Windows > shorl.com/sevadevudygra

















































ad603a7745
Change language: English Brazilian Portuguese Chinese (Simplified) French German Japanese Korean Romanian Russian Spanish Turkish Other Edit Report a Bug imagecopyresized (PHP 4, PHP 5, PHP 7)imagecopyresized — Copy and resize part of an image Description bool imagecopyresized ( resource $dstimage , resource $srcimage , int $dstx , int $dsty , int $srcx , int $srcy , int $dstw , int $dsth , int $srcw , int $srch ) imagecopyresized() copies a rectangular portion of one image to another image. I hope this helps someone. In any case, this new script has been thoroughly tested, cleaned up, and enhanced. $newname ); return $path . then changing imagecopyresampled() with imagecopyresized() removes the noise, found that here: Do not ask me why. " ; } else { echo " " ; echo "bad file type (" .

It saves the generated thumb as myimagetn, in the same directory. $fixedheight . Copyright 2001-2016 The PHP Group My PHP.net Contact Other PHP.net sites Mirror sites Privacy policy . //So loads of image information is retained. /** * Resize an image and keep the proportions * author Allison Beckwith * param string $filename * param integer $maxwidth * param integer $maxheight * return image */ function resizeImage($filename, $maxwidth, $maxheight) { list($origwidth, $origheight) = getimagesize($filename); $width = $origwidth; $height = $origheight; # taller if ($height > $maxheight) { $width = ($maxheight / $height) * $width; $height = $maxheight; } # wider if ($width > $maxwidth) { $height = ($maxwidth / $width) * $height; $width = $maxwidth; } $imagep = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($imagep, $image, 0, 0, 0, 0, $width, $height, $origwidth, $origheight); return $imagep; } up down 2 del at kartoon dot net 11 years ago This snippet allows you to grab a thumbnail from the center of a large image. i.e. # create thumbnails from jpgs # usage: # createjpgthumb(uploaded file, final file (with path), thumb height, thumb width, jpg quality, scale thumb (true) or fixed size (false); function createjpgthumb($original, $thumbnail, $maxwidth, $maxheight, $quality, $scale = true) { list ($srcwidth, $srcheight, $type, $w) = getimagesize($original); if (!$srcImage = imagecreatefromjpeg($original)) { return false; } # image resizes to natural height and width if ($scale == true) { if ($srcwidth > $srcheight ) { $thumbwidth = $maxwidth; $thumbheight = floor($srcheight * ($maxwidth / $srcwidth)); } else if ($srcwidth $thumbheight = $maxheight; $thumbwidth = floor($srcwidth * ($maxheight / $srcheight)); } else { $thumbwidth = $maxheight; $thumbheight = $maxheight; } if (!$destImage = imagecreatetruecolor($thumbwidth, $thumbheight)) { return false; } if (!imagecopyresampled($destImage, $srcImage, 0, 0, 0, 0, $thumbwidth, $thumbheight, $srcwidth, $srcheight)) { return false; } # image is fixed to supplied width and height and cropped } else if ($scale == false) { $ratio = $maxwidth / $maxheight; # thumbnail is landscape if ($ratio > 1) { # uploaded pic is landscape if ($srcwidth > $srcheight) { $thumbwidth = $maxwidth; $thumbheight = ceil($maxwidth * ($srcheight / $srcwidth)); if ($thumbheight > $maxwidth) { $thumbheight = $maxwidth; $thumbwidth = ceil($maxwidth * ($srcwidth / $srcheight)); } # uploaded pic is portrait } else { $thumbheight = $maxwidth; $thumbwidth = ceil($maxwidth * ($srcheight / $srcwidth)); if ($thumbwidth > $maxwidth) { $thumbwidth = $maxwidth; $thumbheight = ceil($maxwidth * ($srcheight / $srcwidth)); } $offh = ($srcheight - $srcwidth) / 2; } if (!$destImage = imagecreatetruecolor($maxwidth, $maxheight)) { return false; } if (!imagecopyresampled($destImage, $srcImage, 0, 0, 0, $offh, $thumbwidth, $thumbheight, $srcwidth, $srcheight)) { return false; } # thumbnail is square } else { if ($srcwidth > $srcheight) { $offw = ($srcwidth - $srcheight) / 2; $offh = 0; $srcwidth = $srcheight; } else if ($srcheight > $srcwidth) { $offw = 0; $offh = ($srcheight - $srcwidth) / 2; $srcheight = $srcwidth; } else { $offw = 0; $offh = 0; } if (!$destImage = imagecreatetruecolor($maxwidth, $maxheight)) { return false; } if (!imagecopyresampled($destImage, $srcImage, 0, 0, $offw, $offh, $maxwidth, $maxheight, $srcwidth, $srcheight)) { return false; } } } imagedestroy($srcImage); if (!imageantialias($destImage, true)) { return false; } if (!imagejpeg($destImage, $thumbnail, $quality)) { return false; } imagedestroy($destImage); return true; } up down 1 tim dot daldini at gmail dot be 9 years ago Tim's function is a whole lot faster, however, the quality setting doesnt seem right since resizing very big images doesnt affect quality of the resulting thumbnails that much on quality 1 for example. $unpacked [ 13 ]); return array( $width , $height ); } else { // Skip block marker and read block size $i += 2 ; $blocksize = unpack ( "H*" , $newblock [ $i ] . * If new width/ height are defined, then resize the PNG (and keep all the transparency info) * Author: Alex Le - */ function imageComposeAlpha ( & $src , & $ovr , $ovrx , $ovry , $ovrw = false , $ovrh = false ) { if( $ovrw && $ovrh ) $ovr = imageResizeAlpha ( $ovr , $ovrw , $ovrh ); /* Noew compose the 2 images */ imagecopy ( $src , $ovr , $ovrx , $ovry , 0 , 0 , imagesx ( $ovr ), imagesy ( $ovr ) ); } /** * Resize a PNG file with transparency to given dimensions * and still retain the alpha channel information * Author: Alex Le - */ function imageResizeAlpha (& $src , $w , $h ) { /* create a new image with the new width and height */ $temp = imagecreatetruecolor ( $w , $h ); /* making the new image transparent */ $background = imagecolorallocate ( $temp , 0 , 0 , 0 ); ImageColorTransparent ( $temp , $background ); // make the new temp image all transparent imagealphablending ( $temp , false ); // turn off the alpha blending to keep the alpha channel /* Resize the PNG file */ /* use imagecopyresized to gain some performance but loose some quality */ imagecopyresized ( $temp , $src , 0 , 0 , 0 , 0 , $w , $h , imagesx ( $src ), imagesy ( $src )); /* use imagecopyresampled if you concern more about the quality */ //imagecopyresampled($temp, $src, 0, 0, 0, 0, $w, $h, imagesx($src), imagesy($src)); return $temp ; } ?> Example usage: header ( 'Content-type: image/png' ); /* Open the photo and the overlay image */ $photoImage = ImageCreateFromJPEG ( 'images/MiuMiu.jpg' ); $overlay = ImageCreateFromPNG ( 'images/hair-trans.png' ); $percent = 0.8 ; $newW = ceil ( imagesx ( $overlay ) * $percent ); $newH = ceil ( imagesy ( $overlay ) * $percent ); /* Compose the overlay photo over the target image */ imageComposeAlpha ( $photoImage , $overlay , 86 , 15 , $newW , $newH ); /* Open another PNG file, then resize and compose it */ $watermark = imagecreatefrompng ( 'images/watermark.png' ); imageComposeAlpha ( $photoImage , $watermark , 10 , 20 , imagesx ( $watermark )/ 2 , imagesy ( $watermark )/ 2 ); /** * Open the same PNG file then compose without resizing * As the original $watermark is passed by reference, it was resized already.

epson m188d driver download windows xpav rack audio driver free download windows 7download autocad 2010 windows 8 64 bitcanon d646u driver download windows 7windows media plugin for mac powerpoint downloadwindows 10 build 9926 download gamesbest pc themes for windows 7 free downloaditunes compatible with windows 7 downloaddownload instagram for windows 8 tabletwindows android early release.exe download


Revenir en haut
Publicité






MessagePosté le: Ven 21 Oct - 14:12 (2016)    Sujet du message: Publicité

PublicitéSupprimer les publicités ?
Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Team Insane Esport.eu Index du Forum -> Team -> Recherche et Destructions normal Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  

Index | Panneau d’administration | faire son forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
onyx © theme by larme d'ange 2006
Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com