PurpleSlade
asked on
Resizing an image on the fly??
Hi, I have a site where people can ftp photos to directories. I have a php script when then traverses the directories and creates links to the photos. The problem is that some of the files are way too big and on a screen set at a lower resolution, like 800 x 600 the pictures overlap some of the css styles I have going. My question is, can I process the files so that a smaller image is created on the fly? This is my code that generates the image itself:
<?php
$image = $_GET['img']; // the image filepath is stored here
$page_title = 'Photos -- ' . $image;
include('../nonPHPBBinclud es/header. inc');
echo '<body>';
?>
<center>
<div class="bluebottomsilver">
<img border="0" src="../images/banner.jpg" ><br />
</div>
<p> </p>
<img border="0" src="../images/banner4.png ">
<p> </p>
<a href="../index.html">Home< /a>
<a href="mainimagepage.php">P hotos</a>
<a href="../index.php">Forums </a>
<a href="../forms/MainRosterF orm.php">R oster</a>
<p> </p>
<?php
echo "<img src='$image'>"; // this is where the image gets displayed.
echo '<p> </p>';
echo '<p> </p>';
echo '</center>';
echo '</body>';
echo '</html>';
?>
<?php
$image = $_GET['img']; // the image filepath is stored here
$page_title = 'Photos -- ' . $image;
include('../nonPHPBBinclud
echo '<body>';
?>
<center>
<div class="bluebottomsilver">
<img border="0" src="../images/banner.jpg"
</div>
<p> </p>
<img border="0" src="../images/banner4.png
<p> </p>
<a href="../index.html">Home<
<a href="mainimagepage.php">P
<a href="../index.php">Forums
<a href="../forms/MainRosterF
<p> </p>
<?php
echo "<img src='$image'>"; // this is where the image gets displayed.
echo '<p> </p>';
echo '<p> </p>';
echo '</center>';
echo '</body>';
echo '</html>';
?>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all - I think tolgaong and dimakh give me what I'm looking for which is a way to programatically create a new image, whether on the fly or scheduled somewhere. In the meantime I went ahead and manually resized everything last night, but will use one of these in the future. Thanks everyone.
<img scr="image" with='80%' height="80%">
or
<img scr="image" with='200' height="200">
So you don't need to create a new resized-image.
Bonmat86.