Forum Moderators: coopster
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?