Great observation Otto! :-)<div><br></div><div>I guess this solves an issue which was haunting me since long!</div><div>I use to manually set "large" size to my content-width and so I always needed to edit "large" size whenever post-content width changed with my theme! This used to create problems with old posts...</div>
<div><br></div><div>Still, rather than hard-coding height and width like </div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">width="640" height="425"</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">WordPress can "push" CSS like </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><meta charset="utf-8">img.size-large {max-width: 640px}</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">where max-width will be value of $</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">content_width</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Using CSS based resizing may take care of change in </span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">$</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">content_width whenever theme changes.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Only thing CSS based height/width on image might have some glitches. As of now I remember only IE6's lack of support for max-width attribute. There may be more!</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Another positive side of CSS-based approach is, CSS will go inside RSS readers where post-content width may differ! It could be </span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">negative side as well, depending on your perspective!</span></div>
<meta charset="utf-8"><meta charset="utf-8"><meta charset="utf-8"><meta charset="utf-8"><div><br></div><div>--<br>Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd.<br>Skype: rahul286 | Twitter: @rahul286 | Web: <a href="http://rtcamp.com/" target="_blank">http://rtcamp.com/</a><br>
<br>
<br><br><div class="gmail_quote">On Tue, Feb 15, 2011 at 11:19 AM, Otto <span dir="ltr"><<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, Feb 14, 2011 at 11:16 PM, Philip M. Hofer (Frumph)<br>
<<a href="mailto:philip@frumph.net">philip@frumph.net</a>> wrote:<br>
> Let me clarify, its usage is apparently inside the editor which makes no<br>
> difference to how it is viewed in output to the end user. Which makes the<br>
> whole functionality of it not useful.<br>
<br>
</div>No, look... I know for a fact this works. I use it all the time. What<br>
you need to understand is how exactly it works...<br>
<br>
Firstly, it only applies to "large" images.<br>
<br>
So, when I upload an image, the image gets resized into thumbnail,<br>
medium, large, and "full" which is not really a resize at all. These<br>
get saved. The resize proportions used are user defined in the<br>
Settings. Those can be anything you like.<br>
<br>
The image_constrain_size_for_editor() function gets called when it's<br>
pulling image sizes to insert into a post. In the specific case where<br>
the "large" image is being inserted, and it's greater than the<br>
$content_width, then the large image will be inserted but it will get<br>
width and height properties on it scaled down to the $content_width<br>
size. Meaning that though the large size image is loading, the browser<br>
itself will do the scaling down of the image to fit within the post<br>
content area.<br>
<br>
Now, if your CSS is wonky, this might not always work. And different<br>
browsers behave differently. But the width and height still do get set<br>
in the image properly.<br>
<br>
It even works in twentyten. I just tried it. Bam, worked. The "large"<br>
size was set to 1024x1024, but what I see when I use the media<br>
uploader gives me a result like this:<br>
<a href="<a href="http://localhost/wp/2011/01/image-test/mcm_6241/" target="_blank">http://localhost/wp/2011/01/image-test/mcm_6241/</a>"<br>
rel="attachment wp-att-354"><img<br>
src="<a href="http://localhost/wp/wp-content/uploads/2011/01/MCM_6241-1024x681.jpg" target="_blank">http://localhost/wp/wp-content/uploads/2011/01/MCM_6241-1024x681.jpg</a>"<br>
alt="" title="MCM_6241" width="640" height="425" class="alignleft<br>
size-large wp-image-354" /></a><br>
<br>
Note two things there. The image is this:<br>
MCM_6241-1024x681.jpg<br>
<br>
But the image tag contains this:<br>
width="640" height="425"<br>
<br>
This is because twentyten has its $content_width set to 640. Really.<br>
<div><div></div><div class="h5"><br>
-Otto<br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></blockquote></div><br></div>