In Styles 1.x, you had this code:

function file_styles_styles_presets() {
  ...
  foreach (image_styles() as $style_name => $style) {
    $presets['file'][$style_name]['image'] = array($style_name);
  }
  ...
}

In Styles 2.x, no such code exists in file_styles_styles_default_presets().

So in 1.x, when I added an image style "foo" via admin/config/media/image-styles/add, and then went to admin/config/media/types/manage/image/display, "File Style: foo" would be a format option for the file field. But in 2.x, it isn't.

This also means that if I upgrade a site from 1.x to 2.x that was using "File Style: foo", then it gets reverted to "Generic File" instead.

Was this an intentional change?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

effulgentsia’s picture

Assigned: Unassigned » effulgentsia

At DrupalCon, Aaron said this was not an intentional change. I'll work on a patch.

oxyc’s picture

Seems like he abstracted this into effects. Currently that line of code exists in file_styles.effects.inc.
file_styles.admin.inc also has some code (commented out) for displaying effects in vertical tabs. I tried working on it but gave up for now.

Although, a proper patch for making image styles available, even if temporarily, would be much appreciated on my side at least. I've made a few attempts at revealing them as presets but they are all ugly hacks.

neurojavi’s picture

subscribing

ybabel’s picture

suscribing too

aaron’s picture

Status: Active » Fixed
aaron’s picture

aaron’s picture

also committed this patch, which adds media styles as formatters.

aaron’s picture

nyl_auster’s picture

It works :)

I tried the latest version on the Git repository and It seems to me that problems are gone. Like Effulgentsia I could not use image presets defined in admin/config/media/image-styles on files styles.

With this update, now, I can.

Thx

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.