Jump to content

thumbnail script


pouncer

Recommended Posts

I found these great thumbnail script



[code=php:0]

<?php

// useage is thumbnail.php?im=imagename.jpg

// set for 120 px thumb

Header("Content-type: image/jpeg");

$orig_image = imagecreatefromjpeg($im);

list($width, $height, $type, $attr) = getimagesize($im);

if ($width > 120) {

$ratio = 120 / $width;

$newheight = $ratio * $height; }

else $newheight = $height;

$sm_image = imagecreatetruecolor(120,$newheight) or die ("Cannot Initialize new gd image stream");;

Imagecopyresampled($sm_image,$orig_image,0,0,0,0,120,$newheight,imagesx($orig_image),imagesy($orig_image));

imageJPEG($sm_image);

imagedestroy($sm_image);

imageDestroy($orig_image);

?>

[/code]



its works great but im not sure which parts to edit to make the thumbnail slightly bigger, and does anyone have a clear understanding off what the code is actually doing?
Link to comment
https://forums.phpfreaks.com/topic/35296-thumbnail-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.