| View previous topic :: View next topic |
| Author |
Message |
Dragon Phoenix
Judge Doom
|
Posted: Fri Mar 24, 2006 4:24 pm Post subject: 1 |
|
|
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 |
|
 |
Antrax
ESL Student
|
Posted: Fri Mar 24, 2006 4:35 pm Post subject: 2 |
|
|
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 |
|
 |
Ctorj
Did I spell that right?
|
Posted: Fri Mar 24, 2006 5:47 pm Post subject: 3 |
|
|
| 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 |
|
 |
Courk
Daedalian Member
|
Posted: Fri Mar 24, 2006 5:49 pm Post subject: 4 |
|
|
| It's in the OT FAQ. |
|
| Back to top |
|
 |
Dragon Phoenix
Judge Doom
|
Posted: Fri Mar 24, 2006 8:19 pm Post subject: 5 |
|
|
I never looked there.... |
|
| Back to top |
|
 |
guest mv*
Guest
|
Posted: Fri Mar 24, 2006 9:03 pm Post subject: 6 |
|
|
| 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
|
Posted: Fri Mar 24, 2006 9:13 pm Post subject: 7 |
|
|
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 |
|
 |
Dragon Phoenix
Judge Doom
|
Posted: Fri Mar 24, 2006 9:15 pm Post subject: 8 |
|
|
| seconded |
|
| Back to top |
|
 |
Courk
Daedalian Member
|
Posted: Fri Mar 24, 2006 10:59 pm Post subject: 9 |
|
|
| Would the resizing tags still be usable if things are automatically resized? |
|
| Back to top |
|
 |
Antrax
ESL Student
|
Posted: Sat Mar 25, 2006 8:18 am Post subject: 10 |
|
|
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 |
|
 |
Samadhi
+1
|
Posted: Sat Mar 25, 2006 9:51 am Post subject: 11 |
|
|
| It'd only resize if they're too big, right? |
|
| Back to top |
|
 |
Courk
Daedalian Member
|
Posted: Sat Mar 25, 2006 9:37 pm Post subject: 12 |
|
|
| 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 |
|
 |
Courk
Daedalian Member
|
Posted: Sat Mar 25, 2006 9:39 pm Post subject: 13 |
|
|
| 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 |
|
 |
MatthewV
Daedalian Member :_
|
Posted: Sun Mar 26, 2006 12:02 am Post subject: 14 |
|
|
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 |
|
 |
jeep
Daedalian Member
|
Posted: Sun Mar 26, 2006 6:52 am Post subject: 15 |
|
|
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 |
|
 |
Samadhi
+1
|
Posted: Sun Mar 26, 2006 7:40 am Post subject: 16 |
|
|
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 |
|
 |
Antrax
ESL Student
|
Posted: Sun Mar 26, 2006 7:56 am Post subject: 17 |
|
|
| 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 |
|
 |
Samadhi
+1
|
Posted: Sun Mar 26, 2006 8:03 am Post subject: 18 |
|
|
| God yes. I couldn't imagine not declaring and just depending on the language to figure it out. |
|
| Back to top |
|
 |
Lucky Wizard
Daedalian Member
|
Posted: Mon Mar 27, 2006 12:49 am Post subject: 19 |
|
|
| 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 |
|
 |
jeep
Daedalian Member
|
Posted: Fri Mar 31, 2006 12:25 pm Post subject: 20 |
|
|
| 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 |
|
 |
|