Kyleva2204
07-15-2005, 09:55 PM
HOW!? I have done a few expirments, but Imageing is now my strong point.. this is what I have:
$image = imagecreatefromjpeg($_GET['file']);
//Grab new image
for( $i=0; $i<imagecolorstotal( $image ); $i++ ) {
$c = ImageColorsForIndex( $image, $i );
$t = ($c["red"]+$c["green"]+$c["blue"])/3;
imagecolorset( $image, $i, $t, $t, $t );
}
ImageJPEG($image, $_GET['file'], '100');
//Create temporary file and write to it
if (is_writable($_GET[file])){
echo $_GET[file];
$fp = $_GET[file];
$fp2 = fopen($fp, 'w') or die ("fudge!");
fwrite($fp2, $image) or die("fudge2!");
fclose($fp2);
echo "done?";
ImageDestroy($image);
}
else echo "dude.. this sucks";
feel free to just forget about what ive done and show me exactly how to do it.. :-D please! hahah
oh and it MIGHt help if i declared what is wrong.. well it practally erases the contents and places "Resource ID #2" as the text in the image file.. and sometiems it says "Fudge2!"... fwrite($fp2, $image) or die("fudge2!");
^_^
$image = imagecreatefromjpeg($_GET['file']);
//Grab new image
for( $i=0; $i<imagecolorstotal( $image ); $i++ ) {
$c = ImageColorsForIndex( $image, $i );
$t = ($c["red"]+$c["green"]+$c["blue"])/3;
imagecolorset( $image, $i, $t, $t, $t );
}
ImageJPEG($image, $_GET['file'], '100');
//Create temporary file and write to it
if (is_writable($_GET[file])){
echo $_GET[file];
$fp = $_GET[file];
$fp2 = fopen($fp, 'w') or die ("fudge!");
fwrite($fp2, $image) or die("fudge2!");
fclose($fp2);
echo "done?";
ImageDestroy($image);
}
else echo "dude.. this sucks";
feel free to just forget about what ive done and show me exactly how to do it.. :-D please! hahah
oh and it MIGHt help if i declared what is wrong.. well it practally erases the contents and places "Resource ID #2" as the text in the image file.. and sometiems it says "Fudge2!"... fwrite($fp2, $image) or die("fudge2!");
^_^