GTPlanet


Go Back   GTP Forums > GTPlanet > Site Feedback

Post Reply
 
Thread Tools
LoudMusic
OldFeb 27 2004, 10:25 AM
I couldn't find a previous referance, but is there a way or could there be a way in the future to size images referanced from other sites? Sometimes we find images that are really cool, but really huge. It would be nice to make them 600 px wide (and let the hight fit proportionately) so that we don't get a horizontal scrollbar.

Infact! I think it would be cool if we could have them defaultly go to that size (maybe 800) and have settings similar to the font system. Small, medium, large. That way people won't be able to hack it and make images huge and obnoxious. Heck, I could attach an image that was a bazillion pixels in both directions and only a few kilobytes. Some code that forces a maximum size would be handy (:
 
GilesGuthrie
Super Moderator
OldFeb 27 2004, 11:00 AM
Yep, you can do this, but only for attached images. You would use the PHP function GetIMageSize(), to make a decision, then calculate an aspect ratio, then write the new size into the attachment display image tag.
 
LoudMusic
OldFeb 27 2004, 11:29 AM
Well, it doesn't really have to be a resize of the image in the file, but using html you could set its display size.

Code:
<img src="something.jpg" width="600">
And the like ...
 
GilesGuthrie
Super Moderator
OldFeb 27 2004, 11:37 AM
Yeah. but you would only want to do that if the image was outside of its constraint. What if someone posted an icon? You wouldn't want it resized to 600px, would you?

So, you get the size of the image, then work out the aspect ratio, then if it's over 600px wide, you put this into the <img> tag:

PHP Code:
<img src="something.jpg" <?php 
if($hsize 600)
{
    echo 
"width=\"600\" height=\"".($vsize $aspect)."\"";
}
?>>
Thus you get PHP to dynamically set the height and width attributes.
 
LoudMusic
OldFeb 27 2004, 12:02 PM
OOoohhh, sorry, I've got a lot going on right now. I totally read your post wrong.

Yes, it would only need to apply sizing tags to images too large. You are correct.

(:

By the way, from one sys admin to another, don't ever take a job administrating Lotus Domino / Notes. It will be the bane of your existance.
 
GilesGuthrie
Super Moderator
OldFeb 27 2004, 5:10 PM
Quote:
Originally posted by LoudMusic
OOoohhh, sorry, I've got a lot going on right now. I totally read your post wrong.

Yes, it would only need to apply sizing tags to images too large. You are correct.

(:

By the way, from one sys admin to another, don't ever take a job administrating Lotus Domino / Notes. It will be the bane of your existance.
Heh! I don't think I ever would. I'm not sure that any of my company's clients use it. We're all about Exchange.

Anyway, I'm moving away from the hardcore tech stuff and concentrating on the Project Management and Project Delivery side.

Which is nice, especially when I pull the "tech guns" out, and blow the Technical Architects away! :sneaky-laugh:

Now my hard-core tech stuff is almost all PHP development, which I'm using for personal projects.
 
LoudMusic
OldMar 03 2004, 4:27 PM
Hey, Jordan, any thoughts on this?
 
GilesGuthrie
Super Moderator
OldMar 03 2004, 4:33 PM
Quote:
Originally posted by LoudMusic
Hey, Jordan, any thoughts on this?
Yep, give me 'til April, and I can provide you with actual code to do it.
 
LoudMusic
OldMar 03 2004, 4:42 PM
Well, keep in mind it would be nice to have a way to fix a maximum size (and even specify that in the user options pannel) and also a way for the person making the post to set a size, similar to the fonts deal.
 
Jordan
GTP Owner/Operator
OldMar 04 2004, 6:46 PM
I have seen some code modifications that do this, Giles, it has been done. There is a chance I'll add it in with GTP6, although I'm not sure yet. It would be handy at times...
 
Shannon
!
OldMar 05 2004, 3:28 AM
Uh, but then you'd still be loading the full image only to see a smaller version, no?
 
LoudMusic
OldMar 05 2004, 10:19 AM
Correct, but it wouldn't blow the web page out of proportion. You know when you get a horizontal scroll how irritating that is?
 
Post Reply

Thread Tools

Forum Jump



Follow GTPlanet on Twitter!
Hot Topics
Best Ferrari biaritz

More On GTPlanet
Forums
- Gran Turismo 5
- GT5 Prologue
- Gran Turismo 4
- Online Racing
- Gaming
- Automotive
- Motorsport
- Multimedia
- Off-Topic!

News Feeds
Subscribe to GTPlanet's news feed for the latest headlines from the world of Gran Turismo!




All times are GMT -5. The time now is 4:08 PM.


Contact Us - Advertising Info - AUP - Privacy Policy

Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2008 GTPlanet.net