944,082 Members | Top Members by Rank

Ad:
Oct 9th, 2009
0

Automagically resize images?

Expand 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
Similar Threads
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is online now Online
1,968 posts
since Feb 2008
Oct 9th, 2009
-1
Re: Automagically resize images?
those are the actual sizes of the images, not the desired size
html Syntax (Toggle Plain Text)
  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.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Oct 10th, 2009
0
Re: Automagically resize images?
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?
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is online now Online
1,968 posts
since Feb 2008
Oct 10th, 2009
-1
Re: Automagically resize images?
they already look poor
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Oct 10th, 2009
0
Re: Automagically resize images?
there is an event handler for img tags complete/oncomplete run a javascript
Reputation Points: 6
Solved Threads: 19
Posting Whiz in Training
fatihpiristine is offline Offline
283 posts
since Sep 2007
Oct 10th, 2009
1
Re: Automagically resize images?
Click to Expand / Collapse  Quote originally posted by daviddoria ...
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%}
Attached Thumbnails
Click image for larger version

Name:	rightsize.png
Views:	14
Size:	89.7 KB
ID:	12064  
Last edited by Troy III; Oct 10th, 2009 at 4:25 pm.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
511 posts
since Jun 2008
Oct 11th, 2009
0
Re: Automagically resize images?
perfect - thanks!
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is online now Online
1,968 posts
since Feb 2008
Oct 11th, 2009
0
Re: Automagically resize images?
Click to Expand / Collapse  Quote originally posted by daviddoria ...
perfect - thanks!
Thanks for thanks, please mark thread as solved.
Last edited by Troy III; Oct 11th, 2009 at 2:57 pm.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
511 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: how
Next Thread in HTML and CSS Forum Timeline: .htaccess redirect, and an anchor link





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC