Jump to content

Recommended Posts

Hey everyone,

 

I am looking for a way to resize images for my website. I have been looking for a script, function, anything that works for a couple of days and nothing has seemed to work the way that I would like it. I am unfamiliar with resizing images using php so I am very confused and completely lost with all of this.

 

I don't want to make a thumbnail and save it in a different directory. I have used the html width="150" height="200" not all of the images are the same size and it makes them look funny.

 

Here is what I have written so far

<a href="../../auto_images/<?php echo "$image"; ?>" rel="lightbox-scans"><img src="../../auto_images/<?php echo "$image"; ?>" width="150px" height="200px"/></a><br />
         <div id="scans">
            <?php 
	   if (!$image2 == "") {
		   echo "<a href=\"../../auto_images/$image2\" rel=\"lightbox-scans\"><img src=\"../../auto_images/$image2\" width=\"30px\" height=\"50px\"/></a> ";
	   }
	   
	   if (!$image3 == "") {
		   echo "<a href=\"../../auto_images/$image3\" rel=\"lightbox-scans\"><img src=\"../../auto_images/$image3\" width=\"30px\" height=\"50px\"/></a>";
	   }
  ?>

 

I am just looking for a simple way of doing this.

 

Thank You

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/238790-resizing-images-on-the-fly/
Share on other sites

instead of using width: and height: you can either set images using a max-width: or max-height: . this will help to maintain the images proportions so you dont get an unproportional funny looking image

 

I did not think of using that.. I did that and it worked perfect. Sometime it is the simplest anwers that you never think of

instead of using width: and height: you can either set images using a max-width: or max-height: . this will help to maintain the images proportions so you dont get an unproportional funny looking image

 

I did not think of using that.. I did that and it worked perfect. Sometime it is the simplest anwers that you never think of

glad it gave you the result that you were looking for, everyone misses the little things sometimes,happens to all of us, if you could, please mark this thread as solved located in the bottom left hand of the page, thank you

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.