Jpeg creation on server
Posted: Tue Dec 06, 2005 6:13 pm
Hi Guys,
I am currently working with Flash and PHP to create .jpg images on the server.
Everything is working fine but now I need to retrieve the file name and path of the created image.
Do any of you know how to do this from the code below?
Any help will be greatly appreciated.
Thanks in advance.
I am currently working with Flash and PHP to create .jpg images on the server.
Everything is working fine but now I need to retrieve the file name and path of the created image.
Do any of you know how to do this from the code below?
Any help will be greatly appreciated.
Thanks in advance.
Code: Select all
<?php
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];
$img = imagecreatetruecolor($w, $h);
imagefill($img, 0, 0, 0xFFFFFF);
$rows = 0;
$cols = 0;
for($rows = 0; $rows < $h; $rows++){
$c_row = explode(",", $_POST['px' . $rows]);
for($cols = 0; $cols < $w; $cols++){
$value = $c_row[$cols];
if($value != ""){
$hex = $value;
while(strlen($hex) < 6){
$hex = "00" . $hex;
}
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
$test = imagecolorallocate($img, $r, $g, $b);
imagesetpixel($img, $cols, $rows, $test);
}
}
}
?>