<?php header('Content-type: image/png'); // Start The Image $im = imagecreatefrompng('/home/nintendo/public_html/picblur/' . $_GET['file'] . '.png'); // Set Text Color function hexrgb($hexstr) { $int = hexdec($hexstr); return array("red" => 0xFF & ($int >> 0x10), "green" => 0xFF & ($int >> 0x8), "blue" => 0xFF & $int); } $colorarr2 = hexrgb($_GET['color']); $text_color = imagecolorallocate($im, $colorarr2['red'], $colorarr2['green'] , $colorarr2['blue']); // Size $_GET['size'] = $size; if($size == '0' || $size > 99 || strlen($size) == 0) { $size = '12'; } else { } //Angle $angle = $_GET['angle']; // Words/Font if(strlen($_GET['word']) < 1 && strlen($_GET['word']) > 0) { $Word = $_GET['word']; } elseif(strlen($_GET['word']) > 0) { $Word = $_GET['word']; } else { $Word = 'Preview'; } if(strlen($_GET['sel']) < 1 && strlen($_GET['font']) > 0) { $Font = $_GET['font']; } elseif(strlen($_GET['font']) > 0) { $Font = $_GET['font']; } else { $Font = 'Pretendo'; } if(file_exists('./fonts' . $_GET['sel'] . '.ttf')) { $Font = './fonts' . $_GET['sel'] . '.ttf'; } elseif(file_exists('/fonts' . $_GET['sel'] . '.ttf')) { $Font = '/fonts' . $_GET['sel'] . '.ttf'; } elseif(file_exists('./' . $_GET['sel'] . '.ttf')) { $Font = './' . $_GET['sel'] . '.ttf'; } else { $Font = '/home/nintendo/public_html/picblur/tools/texttoimage/fonts/' . $_GET['sel'] . '.ttf'; } // Write Text imagefttext($im, $size, $angle, 0, 0, $text_color, $Font, $_GET['word']); // Clearer Text imagepng($im); ?> Code (markup): Generates a Invalid Image. Can someone help me.
This code has so many errors in amazes me. If you comment out the header option, you will be able to see just how many. You ever heard of the isset function? Well yeah, everytime you call one of those $_GET variables, and it isn't set, PHP outputs an error which makes your image invalid. I went to try and fix your code for you, but it's so messed up, you need to start from scratch. It's 90% problems with variables not being set. Like I said, take out the header() function, and you can see all the errors for yourself.
Well obviously they would be set when you are using the code... that should have been fairly obvious.
Look, I'm just trying to tell you your code is crap, start over or hire someone who knows what they are doing. Seriously, take out the headers, you'll see alot more bugs, not just ones involving the $_GET var problems. That is why your image is invalid. Questioned answer, your welcome. Last time I try to help you.
I found out that I was submitting the data the wrong way in the form. Anyway sorry for being an asshole to you.