Jump to content

Resizing images


jchan94

Recommended Posts

So I am working on a php based website for an organization (learning php as well) and I'm having this very basic problem where I can't resize the images to the sizes I want them to be in PHP.

 

Here is where the image gets pointed to:

 

<td rowspan="12"><img src="/images/profiles/<?php echo $user_id ?>.jpg" width:"333" height="500" /></td>
<td>Name: </td>
<td><?php echo $user_name;?> </td>

 

 

I tried the simple img width & height, but the images called upon for each user is still not resizing properly. What am I doing wrong??

 

 
<td rowspan="12"><img width:"333" height="500" src="/images/profiles/<?php echo $user_id ?>.jpg" width:"333" height="500" /></td>
<td>Name: </td>
<td><?php echo $user_name;?> </td>

 

 

 

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

there are several ways to do it. What you're trying is not really resizing, you're just displaying it smaller (the image will look the size you want, but the actual image file stays the same size)

 

with html: (you had a typo in yours)

<img src="/images/profiles/<?php echo $user_id; ?>.jpg" width="333" height="500" />

with inline css:

<img src="/images/profiles/<?php echo $user_id; ?>.jpg" style="width:333px;height:500px;" />

or you can look into PHP's GD Library, that will resize the actual file.

 

Hope this helps

Link to comment
https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470871
Share on other sites

there are several ways to do it. What you're trying is not really resizing, you're just displaying it smaller (the image will look the size you want, but the actual image file stays the same size)

 

with html: (you had a typo in yours)

<img src="/images/profiles/<?php echo $user_id; ?>.jpg" width="333" height="500" />

with inline css:

<img src="/images/profiles/<?php echo $user_id; ?>.jpg" style="width:333px;height:500px;" />

or you can look into PHP's GD Library, that will resize the actual file.

 

Hope this helps

 

I thought it was that simple but the dimensions of the jpeg being called is still not being resized on the page.

Link to comment
https://forums.phpfreaks.com/topic/286569-resizing-images/#findComment-1470874
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.