PHP and GD -> Related problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

PHP and GD -> Related problem

Post by harsha »

Hi
all

I am facing a problem in storing the thumbnail generated using the GD Bundle

the
imagejpeg($image,"/photos/thumb/thumb1.jpg",7);
is not creating the thumb image file

I am using Redhat 9 os
I feel that the default permission of the directory has to be changed

can any one plz tell what may be the problem
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

call the file in a browser and tell us the parse error return.

If it is a permission denied then chmod the /thumb/ directory to allow write and execute at the least.

Also - increase the third parameter of the imagejpeg call to somewhere in the 80-90 region as 7 will not create a full image.
Anything below about 40(%) quality will result in the lower part of the image being reduced to grey blocks due to the composer running out of filesize before completion. I tend toward 85 or 90 for thumbnails as a happy balance of quality vs filesize.
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

if it is
call to undefined function imagejpeg()
it means your version of GD libraries doesnt support JPEGand you will need to install the jpeg-6b libraries, look in the manual.

it could be several things so let us know what the error messages are.
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

Post by toms100 »

imagecreatefromjpeg() might work
a word of warning though: if it is a true colour image then due to bugs in php (at least on myserver) you cannot specify a text colour unless it is in the image!
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

What build are you using toms100 ? just out of curiosity.
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

Post by harsha »

I am using the GD bundle that comes with Redhat 9 i haven't tried to install a new one i think it is GD 2.XXXX
Post Reply