Jump to content

Issue With Thumbnail Script


john_nyc

Recommended Posts

have this site for myspace - editprofiles.com - when you view the graphics it only displays 4 thumbnails - how can i have it display more thumbails?
- i believe that is pulls from the file called thumbs.php which is coded as follows:
<?
include("config.php");
function makeThumbnail($o_file, $t_ht = 100) {
$image_info = getImageSize($o_file) ; // see EXIF for faster way

switch ($image_info['mime']) {
case 'image/gif':
if (imagetypes() & IMG_GIF) { // not the same as IMAGETYPE
$o_im = imageCreateFromGIF($o_file) ;
} else {
$ermsg = 'GIF images are not supported<br />';
}
break;
case 'image/jpeg':
if (imagetypes() & IMG_JPG) {
$o_im = imageCreateFromJPEG($o_file) ;
} else {
$ermsg = 'JPEG images are not supported<br />';
}
break;
case 'image/png':
if (imagetypes() & IMG_PNG) {
$o_im = imageCreateFromPNG($o_file) ;
} else {
$ermsg = 'PNG images are not supported<br />';
}
break;
case 'image/wbmp':
if (imagetypes() & IMG_WBMP) {
$o_im = imageCreateFromWBMP($o_file) ;
} else {
$ermsg = 'WBMP images are not supported<br />';
}
break;
default:
$ermsg = $image_info['mime'].' images are not supported<br />';
break;
}

if (!isset($ermsg)) {
$o_wd = imagesx($o_im) ;
$o_ht = imagesy($o_im) ;
// thumbnail width = target * original width / original height
// $t_wd = round($o_wd * $t_ht / $o_ht) ;
$t_wd = $t_ht;

$t_im = imageCreateTrueColor($t_wd,$t_ht);

imageCopyResampled($t_im, $o_im, 0, 0, 0, 0, $t_wd, $t_ht, $o_wd, $o_ht);

imageJPEG($t_im);

imageDestroy($o_im);
imageDestroy($t_im);
}
return isset($ermsg)?$ermsg:NULL;
}
header("Content-type: image/jpeg");
makeThumbnail($script_dir . "thumbs/" . $img, 150);
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.