Results 1 to 6 of 6
Nov 20, 2004, 09:44 #1
- Join Date
- May 2003
- 0 Post(s)
- 0 Thread(s)
PHP-resized image doesn't display
I searched and found some PHP image resizing code and got it to partly work for me.
If you go to http://sqlcourse.jrickards.ca/includ...48&imgSize=250, you can see a resized image. The original image is 450x450 and the resizing properly resizes it to 250x250.
However, when you go to http://sqlcourse.jrickards.ca/produc...prodid=0480048, the same image should show up in the main area where the error messages exist but obviously, it doesn't.
In the products.php page, I have:
<p><?php include_once("includes/resize_image.php?imgID=0480048&imgSize=250"); ?></p>
Is it a path issue? The calling page, /products.php is in the root folder and the includes folder is /includes and the photos are in /photos. I have tried moving the resize script to the same folder as the photos but no difference in results.
The resize script is:
<?php $origImg = imagecreatefromjpeg("../photos/" . $_GET['imgID'] . ".jpg"); $imageSize = $_GET['imgSize']; $resizedImg = imagecreate($imageSize, $imageSize); imagecopyresampled($resizedImg, $origImg, 0, 0, 0, 0, $imageSize, $imageSize, 450, 450); header("Content-type: image/jpeg"); imagejpeg($resizedImg); ?>