The Grey Labyrinth is a collection of puzzles, riddles, mind games, paradoxes and other intellectually challenging diversions. Related topics: puzzle games, logic puzzles, lateral thinking puzzles, philosophy, mind benders, brain teasers, word problems, conundrums, 3d puzzles, spatial reasoning, intelligence tests, mathematical diversions, paradoxes, physics problems, reasoning, math, science.

   
The Grey Labyrinth Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister  
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Formatting pictures

 
Reply to topic    The Grey Labyrinth Forum Index -> Feature Requests / Site Problems
View previous topic :: View next topic  
Author Message
Dragon Phoenix
Judge Doom



PostPosted: Fri Mar 24, 2006 4:24 pm    Post subject: 1 Reply with quote

Yes, I know this has been addressed, but it is buried somewhere in a thread and every time I want to use it I need a few minutes to find out where. So here it is for everyone who wants to use it:

Just use the image tags, but make the first one instead of img:

img width=xxx height=yyy

with xxx and yyy obviously representing the desired width and height in pixels.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Antrax
ESL Student



PostPosted: Fri Mar 24, 2006 4:35 pm    Post subject: 2 Reply with quote

I should have added it to the FAQ for BBCode, you're right. If any native speaker cares to write a short paragraph on how and why to use these tags, I'll be happy to use it.
_________________
After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ctorj
Did I spell that right?



PostPosted: Fri Mar 24, 2006 5:47 pm    Post subject: 3 Reply with quote

Can you guys post a pic that has been fixed? All someone whould have to do is press quote on it and the code could be seen. I was asking groza about this yesterday and today.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Courk
Daedalian Member



PostPosted: Fri Mar 24, 2006 5:49 pm    Post subject: 4 Reply with quote

It's in the OT FAQ.
Back to top
View user's profile Send private message Send e-mail AIM Address
Dragon Phoenix
Judge Doom



PostPosted: Fri Mar 24, 2006 8:19 pm    Post subject: 5 Reply with quote

Embarrassed
I never looked there....
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
guest mv*
Guest



PostPosted: Fri Mar 24, 2006 9:03 pm    Post subject: 6 Reply with quote

Could the tags be modified so that you don't have to put in a height and have the picture rescale automatically? When posting a picture, people only rescale it to avoid page stretching.
Back to top
Antrax
ESL Student



PostPosted: Fri Mar 24, 2006 9:13 pm    Post subject: 7 Reply with quote

This is a non-trivial change, but I can put it in my list if there's an interest. My name is Earl.
_________________
After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dragon Phoenix
Judge Doom



PostPosted: Fri Mar 24, 2006 9:15 pm    Post subject: 8 Reply with quote

seconded
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Courk
Daedalian Member



PostPosted: Fri Mar 24, 2006 10:59 pm    Post subject: 9 Reply with quote

Would the resizing tags still be usable if things are automatically resized?
Back to top
View user's profile Send private message Send e-mail AIM Address
Antrax
ESL Student



PostPosted: Sat Mar 25, 2006 8:18 am    Post subject: 10 Reply with quote

That's something to consider. Offhand I can't think of a need to resize a picture in a distorting (disproportionate) manner, but it IS supported in HTML.
_________________
After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Samadhi
+1



PostPosted: Sat Mar 25, 2006 9:51 am    Post subject: 11 Reply with quote

It'd only resize if they're too big, right?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Courk
Daedalian Member



PostPosted: Sat Mar 25, 2006 9:37 pm    Post subject: 12 Reply with quote

The only reason for manual resizing tags to remain is if someone wanted to make a picture smaller than the automatic resizing would. Maybe if a post had a few pictures and the poster wanted them to be similar in size or something.
Back to top
View user's profile Send private message Send e-mail AIM Address
Courk
Daedalian Member



PostPosted: Sat Mar 25, 2006 9:39 pm    Post subject: 13 Reply with quote

Or, maybe I'm misinterpreting this. Would the automatic resizing keep the picture proportional with the poster deciding on the size? Like, the poster still inputs, say, the height, and the width is automatically determined to keep it proportional?
Back to top
View user's profile Send private message Send e-mail AIM Address
MatthewV
Daedalian Member :_



PostPosted: Sun Mar 26, 2006 12:02 am    Post subject: 14 Reply with quote

The only direction people resize pictures on this forum is horizontal. When I say automatically, I would still be looking for an imput for the picture's width but not its height.

Lets say I have a picture that is 2340x1745. This is a rather large picture and it would generally be annoying. I would like to make it 750x??? because a width of 750 should be fine. It takes a minute to manually find that the ??? should be 559. I am fairly sure that it isn't hard for the coding to find this number automatically.
Back to top
View user's profile Send private message Send e-mail AIM Address
jeep
Daedalian Member



PostPosted: Sun Mar 26, 2006 6:52 am    Post subject: 15 Reply with quote

This is untested, but it's so simple it probablyonly has 1-2 bugs in it...

This will set a max in either dimension
Code:

function resizeImage ($width, $height, $max) {

    $ratio = ($width > $height) ? ($max/ $width) : ($max/ $height);

    $width = round($width * $ratio); 
    $height = round($height * $ratio);

    return array ($width, $height);
}


This will scale to a maximum width
Code:

function resizeImage ($width, $height, $max) {

    $ratio = $max/ $width;

    $width = round($width * $ratio); 
    $height = round($height * $ratio);

    return array ($width, $height);
}

-JEEP
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Samadhi
+1



PostPosted: Sun Mar 26, 2006 7:40 am    Post subject: 16 Reply with quote

Totally side questions:
Is putting the open bracket on the same line the convention?
Do you not have to declare your variable? Is that what the $ does?

(other than that, I'm glad I'm learning java because it seems highly similar)
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Antrax
ESL Student



PostPosted: Sun Mar 26, 2006 7:56 am    Post subject: 17 Reply with quote

Quote:
Is putting the open bracket on the same line the convention?
It's *a* convention. Personally I abhor it and only use it when patching code where it was already used.
Quote:
Do you not have to declare your variable?
In PHP, no you don't. Note this is usually a bad thing, as a typo in a variable name can lead to annoying bugs that are difficult to solve. However, all variables in php are of the "variant" type, so no declaration per se is required (except possibly for global variables).
Quote:
Is that what the $ does?
The $ just indicates this is a variable.
_________________
After years of disappointment with get rich quick schemes, I know I'm gonna get rich with this scheme. And quick!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Samadhi
+1



PostPosted: Sun Mar 26, 2006 8:03 am    Post subject: 18 Reply with quote

God yes. I couldn't imagine not declaring and just depending on the language to figure it out.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lucky Wizard
Daedalian Member



PostPosted: Mon Mar 27, 2006 12:49 am    Post subject: 19 Reply with quote

Do we really need to calculate the height? In IE 6, and in Netscape 8 set to render like Firefox, the browser seems to resize the height automatically if the width is resized in the HTML.
Back to top
View user's profile Send private message
jeep
Daedalian Member



PostPosted: Fri Mar 31, 2006 12:25 pm    Post subject: 20 Reply with quote

Antrax wrote:
Quote:
Is putting the open bracket on the same line the convention?
It's *a* convention. Personally I abhor it and only use it when patching code where it was already used.


I use it for subroutines, mostly because it works best with the outline feature... it make is so I can shrink down the entire routine into a single line that just says:
Code:

function resizeImage {...}


I sure like that. When the brace is on the next line, it's messy looking. For other blocks, I have the braces on lines by themselves.

Quote:
Quote:
Do you not have to declare your variable?
In PHP, no you don't. Note this is usually a bad thing, as a typo in a variable name can lead to annoying bugs that are difficult to solve.


It can lead to more difficult debugging, but it's convenient, natural, and clean looking.

-JEEP
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous: by   
Reply to topic    The Grey Labyrinth Forum Index -> Feature Requests / Site Problems All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Site Design by Wx3