syamilmj / Aqua-Resizer

Resize WordPress images on the fly
502 stars 208 forks source link

Aqua-Resizer vs. WordPress thumbnails regarding thumb regeneration, tracking and retina support #25

Closed mxmzb closed 10 years ago

mxmzb commented 11 years ago

I would love to have a little discussion about the use of Aqua-Resizer. Following:

I came a little bit in trouble when I had a brainstorming how to realize retina support and do it well while using Aqua-Resizer. In fact, technically it's not that hard to just save a @2x file along with the default one.

But then: How to tell the user in the backend (and when I think this is a serious concern for the AQ-developers here, as some of them may be authors on Themeforest ;) ) if the current image is large enough for retina generation. Of course, one could let this just let alone on the user, but I really wish I could provide something like http://wordpress.org/extend/plugins/wp-retina-2x/ - which would be possible by common WP thumb generation.

I think of that like adding a variable add_image_size('custom_size', $width, $height) function in the functions.php which would get just measures which the user typed in the admin panel. Typing the_post_thumbnail('custom_size') instead of aq_resize() would have almost the same effect, just that the generated files would be tracked and so the plugin I posted above would flawlessly work.

I appreciate any thoughts by everyone. If there is going to materialize some good approach for Aqua-Resizer, I will implement that and in the same run make it a class.

syamilmj commented 11 years ago

I think the biggest problem with retina images is that most themes usually just resize them to max-width 100% and for most cases, the image will get squeezed down to the width of the container, that providing a retina-version of the image is not entirely necessary. For this reason I'm in the opinion that retina functionality, if the theme really needs it, should always reside outside of the script.

Let me know your thoughts on this

mxmzb commented 11 years ago

Well, because I think that exactly what you described is absolutely bad style and wrong for various reasons (I think, this is not how Apple intended that Retina images would be used on the web and regarding that this possibly is a huge needless loading time impact by default), I want to have this solved better.

In my personal opinion, I would really love to see a theme (disregarding of how it is done technically) to create two image versions (default and retina) and load the retina ones only if needed. Plus, having the possibility to show the end user which images are available as retina images and which images miss a retina version, so they could possibly upload a bigger original image to make a retina version or regenerate the thumbnails.

Last two points exactly are where I see the problem in Aqua-Resizer, this is probably going to build in really hard, if not even impossible (because Aqua-Resizer generates images on the fly, on request, while the user would need to continuously see image sizes in the backend). This is a break point, at which one could / should decide if one would to let Aqua-Resizer make the work around retina images or not.

So, if the points I mentioned are possible to do with Aqua-Resizer, I personally would see it as a high improvement and advantage to the script if it would handle it (optionally, of course), because handling one feature (in this case, image handling and generation) at one point is mostly a really good (design) solution.

wpexplorer commented 10 years ago

@maximski - look here: https://github.com/syamilmj/Aqua-Resizer/pull/14

mxmzb commented 10 years ago

@wpexplorer what exactly do you mean? I don't see there anything regarding this issue.