17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1971 Views |
-
Gd Problem

8 November 2007 at 5:22pm
Hi
function ImageObject() {
$gdObject = new GD("/mysite/images/image.png");
$gdObject->resize;
$gdObject->gd;
}I am creating a object for GD But i am getting below error
FATAL ERROR: getimagesize(/mysite/images/image.png) [function.getimagesize]: failed to open stream: No such file or directory
At line 35 in C:\lighttpd\htdocs\sapphire\filesystem\GD.phpplease anybody help me what is wrong in my code
-
Re: Gd Problem

8 November 2007 at 6:55pm
This looks to be a path issue;
You're asking PHP to open this file:
C:\mysite\images\image.pngWhich doesn't exist.
Presumeably you're trying to open
C:\lighttpd\htdocs\mysite\images\image.pngYou need to specify the full path, or use relative filenames. (like ../mysite/images/image.png )
-
Re: Gd Problem

8 November 2007 at 9:38pm
Hi,
thank you for replay,but i already tried for full path then only it is giving same error.
please help me
-
Re: Gd Problem

8 November 2007 at 10:02pm
- Make sure the image exists. When I used GD, I got the filename out the the File table. So something like:
$photo = DataObject::get_by_id("File", $tip->PhotoID);
$GDImage = new GD("../".$photo->Filename);- Don't you have to specify a width and height? what I did was:
$rs = $GDImage->resize($newWidth, $newHeight);
- I am not sure what you're doing with the last line. AFAIK $gd is a protected variable...
Hope this helps.
| 1971 Views | ||
|
Page:
1
|
Go to Top |



