wvisscher
06-22-2004, 02:28 PM
Hi to you all,
I'm new to this forum and i don't know if this is discussed before but I have a request for a script.
Is it possible to collect the client display settings (width and height) at full screen and send this to the server. A PHP script then must process these values to resize an image acording to those values (serverside). The Javascript must then show the resized image full screen on the client computer.
The PHP script i use is:
<?php
function imageresize($width, $height, $target) {
if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}
//gets the new value and applies the percentage, then rounds the value
$width = round($width * $percentage);
$height = round($height * $percentage);
return "width=\"$width\" height=\"$height\"";
}
//get the image size of the picture and load it into an array
$mysock = getimagesize("playa_del_ingles_big.jpg");
?>
<img src="playa_del_ingles_big.jpg" <?php print (imageresize($mysock[0], $mysock[1], 150)); ?>>
How can i do that and pass the values to the script?
Thanks in advance,
Wietze
I'm new to this forum and i don't know if this is discussed before but I have a request for a script.
Is it possible to collect the client display settings (width and height) at full screen and send this to the server. A PHP script then must process these values to resize an image acording to those values (serverside). The Javascript must then show the resized image full screen on the client computer.
The PHP script i use is:
<?php
function imageresize($width, $height, $target) {
if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}
//gets the new value and applies the percentage, then rounds the value
$width = round($width * $percentage);
$height = round($height * $percentage);
return "width=\"$width\" height=\"$height\"";
}
//get the image size of the picture and load it into an array
$mysock = getimagesize("playa_del_ingles_big.jpg");
?>
<img src="playa_del_ingles_big.jpg" <?php print (imageresize($mysock[0], $mysock[1], 150)); ?>>
How can i do that and pass the values to the script?
Thanks in advance,
Wietze