Get image size using php and resize it during showing in html webpage page.

There is a php function list($width, $height, $type, $attr) = getimagesize("picture_name.jpg"); (get full knowledge from http://in3.php.net/manual/en/function.getimagesize.php)
This function save width, height, type, attribute of image in variables. You can use these according your requirements.
Here we are using this function to change width and height of a picture in a html webpage.
$add=images/picture_name.jpg
$size_percent=70/100;
list($width, $height, $type, $attr) = getimagesize($add);
$width=$width*$size_percent;	
  echo"picture size showed only 70%";

This code change image height and width. It decrease size of picture by 30% and show only 70% of full size. It do not change picture aspect ratios.
Valid CSS!

Online Business Solutions

Share |