Encapscms 0.3.6 > Core / Gallery Resize.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Encapscms 0.3.6

Download:
encapscms-0.3.6.zip

Category:
Content Management

Archive Content:

Encapscms 0.3.6 > Admin

Encapscms 0.3.6 > Admin > Html

Encapscms 0.3.6 > Admin

Encapscms 0.3.6 > Admin > Sql

Encapscms 0.3.6

Encapscms 0.3.6 > Core

Encapscms 0.3.6

Encapscms 0.3.6 > Html

Encapscms 0.3.6 > Html > Expo

Encapscms 0.3.6 > Html > Expo > Images

Encapscms 0.3.6 > Html > Expo > Images > Gallery

Encapscms 0.3.6 > Html > Expo > Images

Encapscms 0.3.6 > Html > Expo > Images > Temp

Encapscms 0.3.6 > Html > Expo > Images

Encapscms 0.3.6 > Html > Expo

Encapscms 0.3.6 > Html > Light

Encapscms 0.3.6 > Html > Raym

Encapscms 0.3.6 > Html > Raym > Equipment Files

Encapscms 0.3.6 > Html > Raym > Equipment Files > Temp

Encapscms 0.3.6 > Html > Raym

Encapscms 0.3.6 > Html > Raym > Img

Encapscms 0.3.6 > Html > Raym

Encapscms 0.3.6 > Img

Encapscms 0.3.6

Encapscms 0.3.6 > Sql

Encapscms 0.3.6

Gallery Resize.php:


<?
$filename 
$_GET["filename"];
if(
$filename == '')return;
$max_size = (isset($_GET["size"]))?$_GET["size"]:150;
$size getimagesize($filename);
$w $size[0];
$h $size[1];
$tmp=0;
if(
$w >= $h)
    
$tmp $w/$max_size;
else
    
$tmp $h/$max_size;

$image imagecreate($w/$tmp, $h/$tmp);

if(
stristr($filename, ".png")){
    
$img_old imagecreatefrompng($filename);
    
imagecopyresized($image, $img_old, 0, 0, 0, 0, $w/$tmp, $h/$tmp, $w, $h);
    
header("Content-type: image/png");
    
imagepng($image);
}elseif(
stristr($filename, ".jpg")){
 
$im=@imagecreatefromjpeg($filename);                // path to your gallery
   
$small imagecreatetruecolor($w/$tmp, $h/$tmp);    // new image
   
ImageCopyResampled($small,  $im,  0,  0,  0,  0,  $w/$tmp,  $h/$tmp,  $w, $h);
    
header("Content-type: image/jpeg");
    
imagejpeg($small);
   
ImageDestroy($im);      
}elseif(
stristr($filename, ".gif")){
    
$img_old imagecreatefromgif($filename);
    
imagecopyresized($image, $img_old, 0, 0, 0, 0, $w/$tmp, $h/$tmp, $w, $h);
    
header("Content-type: image/gif");
    
imagegif($image);
}
?>



Other Content Management Scripts:

WebMaster Resources Home

©RingsWorld.com