I'm sure this is a permissions issue, but I can't figure it out.
I have the following pretty standard code to generate thumbnails on-the-fly:
if (!file_exists($thumbdir.$imagefile)) { // and make sure it's got a thumbnail
$img = imagecreatefromjpeg( $imagedir.$imagefile );
$width = imagesx( $img );
$height = imagesy( $img );
$new_width = $thumbWidth;
$new_height = floor( $height * ( $thumbWidth / $width ) );
$tmp_img = imagecreatetruecolor( $new_width, $new_height );
imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
if (!is_writable($thumbdir.$imagefile)) echo $thumbdir.$imagefile." isn't writable!<br>";
imagejpeg( $tmp_img, $thumbdir);
imagedestroy( $tmp_img );
}
which throws this error:
Warning: imagejpeg() [function.imagejpeg]: Unable to open '/hermes/web07d/b1074/moo.nathanaelculver/accardi/canon/BeyondZork/Greybox/thumbs/' for writing: Is a directory in /hermes/web07d/b1074/moo.nathanaelculver/accardi/canon/layout.php on line 97
Line 97 is the imagejpeg($tmp_img, $thumbdir) statement.
In addition, line 96 tests true (i.e., (!is_writable) = TRUE, and I get "isn't writable").
phpinfo() reports safe_mode is off, register_globals is off. open_basedir is not set. I've tried chmoding everything from Greybox/ on down to both 757 and 777 with no luck.
What am I missing?
--Nathanael