GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   HTML/DHTML/Scripting & Image gurus... (https://gfy.com/showthread.php?t=206437)

acctman 12-09-2003 10:09 AM

HTML/DHTML/Scripting & Image gurus...
 
I think my subject covered everyone that could possibly help. I have a question, does anyone know how to scale an image maintaining the aspect ratio of the image, with or close to 350h or 350w? I don't want to change the original image at.

Is there a HTML, DHTML or Script that will force a image to be displayed with a set ratio dimension?

I want to be able to load images into a table cell and not have to resize the images manually before hand, since users will be automatically uploading images.

Juicy D. Links 12-09-2003 10:11 AM

photoshop

dotwind 12-09-2003 10:36 AM

you can even just set the width and height in the img tag that would show it with the desired width and height if you wanna keep the ratio i don't think hahahahahahahahahaha can do that i didn't look into it but it can be done easily with a server side script.

DW

pornanza 12-09-2003 11:49 AM

you can just set &ltimg src="" width="350"&gt but each user will be downloading the full image = slow & more bandwidth

the following code will thumbnail the image

PHP Code:


 
function resize($width$image$photoFolder$thumbFolder) {
  
$size getimagesize("$photoFolder/$image");

  
$length = ($size[1] * round($width $size[0] * 100)) / 100;

  if (
$length $width) { $length $width$width = ($size[0] * round($length $size[1] * 100)) / 100; }

  
$source imagecreatefromjpeg("$photoFolder/$image");
  
$destination imagecreatetruecolor($width$length);

  
imagecopyresampled($destination$source0000$width$length$size[0], $size[1]);
  
imagejpeg($destination"$thumbFolder/$image"75);
 } 

ryan


All times are GMT -7. The time now is 08:16 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123