A different approach to responsive images. Current projects try to make this process automatic by offering different sizes of an image style in the same proportions that it was originally created with. This module takes into consideration that at different viewports you may want the image to be sized differently. For example, on desktop dimensions you may want an image to be wide, but on mobile dimensions you may want the image to be narrow but longer. This module allows you to create the image style for each viewport you are targeting and then telling Drupal when to show the desired image based on viewport width. In internal testing on a page that is very heavy with imagery there was a savings of 152k (around 43% savings) between the desktop viewport and the mobile viewport.
This project also includes some additional helpers such as lazy loading of the images to conserve bandwidth.
Project sandbox: http://drupal.org/sandbox/ay13/1355098
Repo: http://drupalcode.org/sandbox/ay13/1355098.git
Branch: 7.x-1.x
This project is for Drupal 7.x and above, there are no plans to backport to 6.x but if a case is made for it or someone else does the work we will gladly add it.
** This project is a collaboration between andrewko (http://drupal.org/user/241418) and me. If it is possible, he should also be whitelisted for future modules as we are both going through this application process together.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | error_message.png | 37.45 KB | iptechlabs |
Comments
Comment #1
klausiWelcome,
we are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #2
jazzdrive3 commenteday13,
It seems this module aims to do the same thing as Responsive Images and Style (http://drupal.org/project/resp_img). It too uses image styles and allows you to use them based on screen width. The image styles can be vastly different as well.
The lazy loading of images is an interesting idea, but you may consider contributing a patch to a module that is already pretty mature and well supported.
Comment #3
andrewko commentedjazzdrive3,
There are a number of architectural differences between our module and resp_img that makes ours more flexible.
With resp_img you can only set up one set of breakpoints that all responsive images use. Our module allows you to set up a set of breakpoints for each responsive image type. So you could have totally different breakpoints for different image fields. Now this can be a down side if you do want to use the same breakpoints for each image style, but that's something we can address prior to the 1.0 release. I can see that being a default list of breakpoints and a way to override them per responsive collection.
With resp_img you can't reuse image styles across responsive styles. With our module you select image style for the breakpoint not vice versa. This way you don't have duplicate your styles if you need to use the same one within a responsive style or between responsive styles.
We're not using image styles to store any information about the responsive styles, there are a set of DB tables inspired by the image_style tables that hold the collections and the breakpoint/image style associations. The only caveat to that is the quick dirty hack I put in to get the module to work with file styles where the responsive collections show up under the image_style list, but I'll be redoing that prior to the 1.0 release so that file styles is properly implemented.
I hope that clears up the differences.
--Andrew
Comment #4
iptechlabs commentedHello,
There is a displayed bug when I click on Delete button to delete a responsive groups entry and confirm it.
Comment #5
andrewko commentediptechlabs, thanks for spotting. It should be fixed now.
Comment #6
sreynen commented#5 suggest this is ready for another review.
Comment #7
jazzdrive3 commentedThere are some code styling issues, as well as files still in the master branch.
Details can be found at:
http://ventral.org/pareview/httpgitdrupalorgsandboxay131355098git
Comment #8
attiks commentedRegarding #3:
Regarding the overwrite of theme_image_style, this means that if somebody overwrites this in his theme, your module will stop working, better add it to the project page and/or README. You can have a look at the resp_img code to see how we handled it.
If you're interested we can still merge the 2 modules, meaning that we can add support for response.js to resp_img so people can choose one or the other.
Comment #9
mxtIs this module similar to yours?
http://drupal.org/project/cs_adaptive_image
thank you
Comment #10
andrewko commentedattiks,
I'm all for consolidating similar modules, but I do like the schema, admin UI structure and flexibility of ours. Is this something you'd be open to me adding to resp_img for a 2.0 release? Obviously that would be a big architectural change and an upgrade path would be needed.
I'm thinking about a configuration of a "base" set of breakpoints that the user can override per collection if they want. I think that's the best of both worlds.
Comment #11
andrewko commentedMXT, It's similar but you are confined to a predefined number of breakpoints and you have to set them up per field instance, which seems pretty tedious.
Comment #12
attiks commentedandrew,
I like the idea of merging, but I'm wondering how you will handle inline content like an image inserted into the body of a node. I you want to try merging, clone resp_img into a sandbox to test it and create an issue in the resp_img issue queue so we can discuss this further.
Comment #13
andrewko commentedattiks, that's a really valid point. We had only looked at this module from an image/file field perspective and not for inline images. That's going to take some thinking. Right now I can only see it working if we inject the responsive styles into the image style list and catch it before the theme function get's a hold of it, much like my dirty hack is doing for file styles. I'm open to other ideas.
I'll talk it over with ay13 about the option of trying to merge into resp_img
Comment #14
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #14.0
klausiAdding attribution to andrewko as a co-maintainer of this module