[theme-reviewers] Image Resizing

Rahul Bansal rahul.bansal at rtcamp.com
Sat Feb 12 04:50:34 UTC 2011


I completely agree with your point - "Suggesting to everyone that they have to run a plugin every time they decide to change their image sizes seems to be fraught with the risk of being lynched."

I had similar situation and my theme was approved. 
As you have nicely explained the use case, you should't face any issues IMHO

-Rahul

Sent from my iPhone

On 12-Feb-2011, at 7:03 AM, Sayontan Sinha <sayontan at gmail.com> wrote:

> Hi,
> At the risk of flogging a dead horse I would like to venture a few questions about image resizing. I know that this topic has done the rounds several times, but I just wanted some clarity before uploading the next version of my theme.
> 
> I was using TimThumb for resizing, which I eliminated in my upcoming release. To do so, however, I had to use a few tricks:
> I am using the concept of registered image sizes. So if you set a custom size for an image, it is being added using the add_image_size function.
> Now, considering the case where a size change is being registered after the image has been uploaded, I am broadly using the method outlined http://core.trac.wordpress.org/ticket/15311.
> Note that for historical reasons I have functionality similar to the "Get the Image" plugin in my code, whereby you could retrieve images based on the featured image, or a custom field or an attachment or an embedded URL. So it is imperative to have some kind of resizing functionality that works above and beyond the native WP resizing capabilities (which I am anyway using). This is where the above script comes really handy, but needs a good few modifications. To cite a few examples:
> I have made the method work for external URLs, plus the size parameters are actually based on the registered sizes and not "GET" parameters.
> The resizing is only invoked if an image of "intermediate" size (the fourth parameter of wp_get_attachment_image_src()) is not returned by the post thumbnail functionality. Also note that due to this means I cannot use the_post_thumbnail by itself, but I have to use wp_get_attachment_image_src(), which is called by wp_get_attachment_image(), which is called by get_the_post_thumbnail(), which in turn is called by the_post_thumbnail.
> The result of the above is a seamless transition (hopefully) from my previous approach that used TimThumb to the current approach. The reason I have gone this route is so that users don't freak out when they see their images have not been correctly resized. Suggesting to everyone that they have to run a plugin every time they decide to change their image sizes seems to be fraught with the risk of being lynched. 
> 
> Is this going to be acceptable for a review? I know that it is probably difficult to say without actually seeing the code, but I thought I should try my luck.
> 
> Regards,
> Sayontan.
> 
> -- 
> Sayontan Sinha
> http://mynethome.net | http://mynethome.net/blog
> --
> Beating Australia in Cricket is like killing a celebrity. The death gets more coverage than the crime.
> 
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110212/3e93037e/attachment.htm>


More information about the theme-reviewers mailing list