1. Support ctools exportables
  2. Add upgrade path from 7.x-1.x
  3. Support inline images

Comments

attiks’s picture

Assigned: Unassigned » jelle_s
attiks’s picture

+Support inline images

jelle_s’s picture

I took a look at a possible upgrade path.

We could, for each suffix defined in resp_img 1.x, create a breakpoint with (min-width: $value px) for the media query where $value is the breakpoint that was defined for that suffix.

And then we have some options:

  • Add these breakpoints to all defined groups.
  • Don't add them to any group, just leave them in 'global',
  • Create a new group 'Legacy' (or any other name) and add the breakpoints to that group.
  • Create a group per image style (see further explanation below)

And then there's the mappings... Not sure what to do with the multipliers, what styles to map to which breakpoint etc.

One last issue:
In 1.x one breakpoint (suffix) could have multiple image styles (thumbnail_mobile, large_mobile, ...). But now, within each group, each breakpoint is linked (mapped) to one image style. Which brings me to the fourth option mentioned above:
We could get the default suffix defined in 1.x, load all image styles ending with the default suffix and then create a group for each of those styles.

For example:if you would have the suffixes _mobile, _normal, _highres and the default suffix was '_mobile', then we would load all image styles ending in _mobile (e.g.: thumbnail_mobile, medium_mobile, large_mobile) and then create a group for each image style, resulting in the groups thumbnail, medium and large. Then we can map all breakpoints to the right image style within the right group:

  • group thumbnail:
    • breakpoint default => image_style thumbnail_mobile
    • breakpoint medium => image_style thumbnail_normal
    • breakpoint large => image_style thumbnail_highres
  • group medium:
    • breakpoint default => image_style medium_mobile
    • breakpoint medium => image_style medium_normal
    • breakpoint large => image_style medium_highres
  • group large:
    • breakpoint default => image_style large_mobile
    • breakpoint medium => image_style large_normal
    • breakpoint large => image_style large_highres

Any thoughts?

attiks’s picture

++ for the last option, but this also means checking all file/image field display settings and changing them accordingly

jelle_s’s picture

The mappings now support ctools exportables.

jelle_s’s picture

++ for the last option, but this also means checking all file/image field display settings and changing them accordingly

I'll have a look at that.
We can get all related field instances like this:

field_read_instances(array('field_name' => array_keys(field_read_fields(array('type' => array('image', 'file'))))));

And then update them with

field_update_instance($instance);

So I think it should be possible ;-)

jelle_s’s picture

There now is an upgrade path from 1.x to 2.x following the steps outlined in #3, #4 and #6

To upgrade, follow these steps:

  1. Disable Responsible images and styles (do not uninstall) (you need to do this because we don't use the custom cache class in 2.x anymore. Related: #1706596: Invalid callback)
  2. Download Breakpoints, CTools and Field formatter settings.
  3. Enable Responsible images and styles again (along with its requirements Breakpoints, CTools and Field formatter settings).
  4. Go to /update.php and follow the steps.
  5. And you're done!

I'll document this on the project page as well.

jelle_s’s picture

Issue summary: View changes

Updated issue summary.

attiks’s picture

Great, for the moment 2.x is missing some of 1.x functionality (ex. context support), so both will exist for some time, the recommended version for Drupal 7 is still 1.x

attiks’s picture

Issue summary: View changes

Updated issue summary.

attiks’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Old issue, I think you better update to the picture module