Automagically resize images?

Thread Solved

Join Date: Feb 2008
Posts: 638
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

Automagically resize images?

 
0
  #1
Oct 9th, 2009
Is there anyway to get images to be the "correct" size - i.e. fit the width of the text?

This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml

Thanks,

Dave
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,398
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 170
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso
 
-1
  #2
Oct 9th, 2009
those are the actual sizes of the images, not the desired size
  1. <div id="main">
  2. <h1>Pictures</h1>
  3. <img width='594' height='292' alt='alt text is a requirement' src="Pictures/3DIM_poster.jpg" />
  4. Poster presentation at 3DIM 2009.
  5. <img width='594' height='612' alt='alt text is a requirement' src="Pictures/scanner_inside.jpg" />
  6. Leica HDS3000 LiDAR scanner in the lab.
  7. <img width='594' height='612' alt='alt text is a requirement' src="Pictures/scanner_outside.jpg" />A day of scanning in Troy.
  8. </div>
I just pulled the sizes off the smallest image, and resized the others by proportion 730*752 > 594*612

its not a good idea to use html to resize images to suit the layout
actually resize the images with Irfanview, paintshop etc,
and serve them the correct size, (still with the sizes specified in the xhtml) smaller images = faster load times

notes
1:: the layout sucks, fixed width central column may look good on your pc,
mine is 2400px wide, what a waste of space
Ems and % are the dimensions of choice, width will adjust to screen and window size, keeping the same proportion as your design screen, on a wider range of systems
2:: incidental; the only bugs in the code is the missing alt tags in those images
Last edited by almostbob; Oct 9th, 2009 at 9:44 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 638
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster
 
0
  #3
Oct 10th, 2009
I agree about the layout. However if I let the page expand to the screen width then the images specified in pixels will look too big/small unless the resolution is the same as my design resolution, right?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,398
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 170
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso
 
-1
  #4
Oct 10th, 2009
they already look poor
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training
 
0
  #5
Oct 10th, 2009
there is an event handler for img tags complete/oncomplete run a javascript
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
1
  #6
Oct 10th, 2009
Originally Posted by daviddoria View Post
Is there anyway to get images to be the "correct" size - i.e. fit the width of the text?

This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml

Thanks,

Dave
So you want them to be looking something like this (see attachment image)?
Add this line in your
CSS
HTML and CSS Syntax (Toggle Plain Text)
  1. #main img {width:100%}
Last edited by Troy III; Oct 10th, 2009 at 4:25 pm.
Attached Thumbnails
rightsize.png  
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 638
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster
 
0
  #7
Oct 11th, 2009
perfect - thanks!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #8
Oct 11th, 2009
Originally Posted by daviddoria View Post
perfect - thanks!
Thanks for thanks, please mark thread as solved.
Last edited by Troy III; Oct 11th, 2009 at 2:57 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 515 | Replies: 7
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC