Code: Select all
[img width=400]image url[/img]
Code: Select all
[img height=300]image url[/img]
But I could also distort the aspect ratio and post the same image like this,
Code: Select all
[img width=1200 height=675]image url[/img]
What I want to be able to do is when I quote a post that has images in it, they're scaled down to a maximum width and maximum height (e.g. 256) but maintaining the aspect ratio they were displayed at in the original post.
For example, I post an 800x600 image with a width of 400 so it's displayed at 400x300. I then quote the post and the image in the quote is displayed at 256x192, still 4:3. Or I post the image with a height of 300 so it's still displayed at 400x300, then I quote the image and it's still displayed in the quote at 256x192. But say I distort the image by switching its height and width around thereby reversing its aspect ratio. So I post
Code: Select all
[img width=300 height=400]image url[/img]
Or say I post the image like I mentioned before,
Code: Select all
[img width=1200 height=675]image url[/img]
Is what I'm asking for possible without an add-on to the extension? Is it possible at all, even with an add-on? I've been experimenting with adding code to the stylesheet,
Code: Select all
blockquote img {
max-width: 256px;
max-height: 256px;
}
1.
Code: Select all
[img]image url[/img]
Actual result: 341x256 (Still 4:3 but I wanted the width no greater than 256)
2.
Code: Select all
[img width=720]image url[/img]
Actual result: 720x256
3.
Code: Select all
[img height=540]image url[/img]
Actual result: 341x256
This one really confuses me. Why is this actual result the same as the first actual result? If putting in
width=720
resulted in the quoted image being 720x256, surely putting in height=540
should result in the quoted image being 256x540.4.
Code: Select all
[img width=540 height=720]image url[/img]
Actual result: 540x256
This actual result is similar to the second actual result. When I put in
width=720
, the quoted image displayed at 720x256. Now that I put in width=540
, the quoted image is displaying at 540x256. Makes sense. Except that what I actually put in was width=540 height=720
so the height is being completely ignored for some reason.5.
Code: Select all
[img width=960 height=540]image url[/img]
Actual result: 960x256
So this is similar to the 2nd and 4th actual results. The quoted image gets displayed at the entered width but in this case and in the 4th, the height is completely ignored.
I don't understand any of this. It all seems very counter-intuitive and illogical. I know that it's very easy to scale down images in quotes if the images are posted with just the default BBCode. If I add the following code to the stylesheet,
Code: Select all
blockquote img {
max-width: 256px !important;
max-height: 256px;
}
Code: Select all
blockquote img {
max-width: 256px !important;
max-height: 256px;
}
Code: Select all
blockquote img {
max-width: 256px;
max-height: 256px;
}
!important
bit doesn't help, it just makes things more confusing. If I post a 4:3 image with just the default BBCode or with a width specified, the image will be scaled down in a quote to 256x192, but if I specify a height, reverse the aspect ratio, or change the aspect ratio to 16:9, I get the exact same result every time. The image is consistently scaled down to a perfect square, 256x256. I just can't make any sense out of all this.