thumbnails
Posted: Sun Nov 26, 2006 3:07 pm
feyd | Please use
i got this code, but i would like to know how can i make this so i can put it on mysql..
becuase the imageJPEG() function saves the picture and makes the picture show on the page i just want to keep the picture in a variable so i can insert it in the sql table i got set up..
if you need a better explanation please let me know..
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
<?php
// The file name you wish to get
$filename = 'images/pic.jpg';
// Content type
header('Content-type: image/jpeg');
//takes the with and height of file
list($width, $height) = getimagesize($filename);
$newWidth=120;
$newHeight=intval($height*$newWidth/$width);
$oldImage=ImageCreateFromJPEG("$filename");
$newImage=ImageCreateTrueColor($newWidth,$newHeight);
imagecopyresampled($newImage,$oldImage,0,0,0,0,$newWidth,$newHeight,$width,$height);
ImageJPEG($newImage,"TN"."jhon.jpg");
?>becuase the imageJPEG() function saves the picture and makes the picture show on the page i just want to keep the picture in a variable so i can insert it in the sql table i got set up..
if you need a better explanation please let me know..
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]