Forum Moderators: coopster

Message Too Old, No Replies

problem with thumbnail creation (GD)

thumbnails are just black!

         

fwordboy

9:53 am on Mar 14, 2005 (gmt 0)

10+ Year Member



Hello

I'm using a function found here:
[onlinetools.org...]

to create thumbnails from images I've just uploaded.

The problem is that, although the smaller images are being created, they're
turning out as just plain black - no other colours. This makes me think that
the function isn't reading the source image properly however, I think that I
have coded it correctly.

Here's how I've called the function, N.B. the variable $filename has been
previously defined as the name of the uploaded image file earlier in my
code.

$gd2=checkgd();
$location = $_SERVER["DOCUMENT_ROOT"]."/images/";
create_thumb($location.$filename,"../images/thumbs/".$filename,50,50);

I have also tried calling it as:

$gd2=checkgd();
create_thumb("../images/".$filename,"../images/thumbs/".$filename,50,50);

Let's say I upload an image called gold.jpg, the function creates a new,
albeit all black, thumbnail called tn_gold.jpg. If the $filename variable
was corrupted then it wouldn't be able to name the thumbnail as tn_gold.jpg
so that can't be the problem. Also, the directory, I can't imagine to be
incorrect for reading the original image as the program has no problems
writing to the folder within it called thumbs.

Any ideas?

fwordboy

9:41 pm on Mar 14, 2005 (gmt 0)

10+ Year Member



I figured it out, thanks to the help opf the original script writer. the problem was the function that is called, to check whether gd2 is installed or not, was at fault.

removing that, and telling the script that gd2 was installed, helped tremendously