Closed (fixed)
Project:
Responsive images and styles
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
24 May 2012 at 11:42 UTC
Updated:
13 Jun 2012 at 18:01 UTC
I have these prefixes
and have these styles:
Default responsive prefix is _auto. After resizing of window (for example, 240px) supposed to apply _100 prefix but it not found. It would be nice if applied existed prefix (best fit) or default prefix.
Comments
Comment #1
attiks commentedThis is indeed not supported, the easy fix is to define image_100 the same as either image_auto or image_200. The problem with automating this is that it will depend on the particular use case.
Changing to feature request so I can think about it for a couple of days.
Comment #2
blod12312 commentedIn my case, if I define 5 suffixes and assume 3 types of styles (sidebar_*, content_* and the gallery_*), then I'll have to create 15 styles of images. It will take quite some time.
I think the quick solution is in function resp_img_get_best_suffix, where you need to check the appropriate style prefixes for existence and to choose the right.
Thank you. I'll wait for your solution.
Comment #3
attiks commented@emit.it3 i know it's a lot right now to do by hand, I'm going to add a form that will duplicate styles so you can select an existing image style and it will duplicate it for all defined suffixes, but i need to find the time ...
Comment #4
attiks commentedComment #5
jelle_sIn the latest dev version you can now go to admin/config/media/resp_img/create_style and add responsive styles in a more user friendly manner
Comment #6
jelle_sThe thing is that this module relies on all the styles (one for each suffix) being present. The actual functionality boils down to this function:
which basically does a string replace of the default suffix with the suffix that is best for the current window with.
Because it's just a string replace, we can't check if that image style actually exists...
Marking this as fixed (because of the easier way you can now add image styles).
Comment #7
blod12312 commentedThanks.
Comment #8.0
(not verified) commentedSome mistakes.