How can I make multiple resizes of an uploaded image?
what is the code like for making the multiple resizes of one uploaded image.
How can I make multiple resizes of an uploaded image?
what is the code like for making the multiple resizes of one uploaded image.
Read documentation. Basically, you need a php file to process each thumb. It should look like this one:
<?php
require_once 'miniaturas/ThumbLib.inc.php';
$fileName = (isset($_GET['filename'])) ? urldecode($_GET['filename']) : null;
if ($fileName === null || !file_exists($fileName))
{
// handle missing images however you want... perhaps show a default image?? Up to you...
}
try
{
$thumb = PhpThumbFactory::create($fileName);
}
catch (Exception $e)
{
// handle error here however you'd like
}
$thumb->adaptiveResize(90, 90);
$thumb->show();
?>
Then, you call images this way:
<img src="thumbs_maker.php?filename='.$path.'" class="thumb" alt="" />
Each <img> call will return you a thumb.
cant i do this in the same file instead of another and use Get?
You must log in to post.