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
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

Edited by WebStyles
Link to comment
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.

Edited by jchan94
Link to comment
Share on other sites

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.