Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Thumbnailing Using PHP

 
webmaster forum
techman  Offline
Activity
0%
 
New Poster
Posts: 5
Topics: 4
October 04, 2008, 08:14:51 PM

I have bunch of images in a folder. I want to make thumbnails while displaying them for viewing purpose. I want something which makes thumnail at runtime and erase thumbnails after displaying on the page.

Hope I will find some help here.
 
webmaster forum
Roman  Offline
Activity
0%
 
New Poster
Location: Russia
Gender: Male
Age: 29
Posts: 13
Topics: 0
December 26, 2008, 12:26:36 PM

You can use this class for example (http://phpclasses.segmenta.ru/browse/package/3125.html).
 
webmaster forum
Activity
0%
 
New Coder
Posts: 26
Topics: 12
January 21, 2009, 05:02:07 AM

you can use this php code for image resize...
name this as imgresize.php
Code:
<?php
$height
50;
$width50;
// Content type
header('Content-type: image/jpeg');
if(!
$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig$height_orig) = getimagesize($filename);

if (
$width && ($width_orig $height_orig)) {
$width = ($height $height_orig) * $width_orig;
} else {
$height = ($width $width_orig) * $height_orig;
}

// Resample
$image_p imagecreatetruecolor($width$height);
$image imagecreatefromjpeg($filename);
imagecopyresampled($image_p$image0000$width$height$width_orig$height_orig);

// Output
imagejpeg($image_pnull100);
ImageDestroy ($image_p);
?>


$img = xxx; /// change xxx to img name
echo "<img src=\"imgresize.php?filename=$img\" alt=\"$$img\"/>";
hope this will help you mate!
 
webmaster forum
leonle  Offline
Activity
0%
 
New Poster
Posts: 11
Topics: 0
January 24, 2009, 06:12:15 PM

Thanks I have been looking for this  thumbup
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 07, 2012, 07:54:35 PM