Try placing a hyphen in your image style name. Images created by that image style have a mangled path and won't display.

It looks like the culprit is the preg_match() in image_field_formatter_view()

  if (preg_match('/__([a-z0-9_]+)/', $display['type'], $matches)) {
    $image_style = $matches[1];
  }

which (if the $display['type'] has a hyphen in it) will created a truncated $image_style and (eventually) an incorrect image path.

E.g.,

You have an image style name of "example-with-hyphen". But the initial path created is /image/generate/example/public/IMAGE_NAME.jpg, which will send back a 404.

I'm assuming that the actual bug is in preg_match() [vs. simply not allowing hyphens in names, to begin with].

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

CrookedNumber’s picture

CrookedNumber’s picture

Status: Active » Patch (to be ported)
CrookedNumber’s picture

Status: Patch (to be ported) » Needs review
aspilicious’s picture

looks fine can someone test this code?

andypost’s picture

AaronBauman’s picture

Status: Needs review » Reviewed & tested by the community

confirmed bug.
verified patch #1 fixes it.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD.

Status: Fixed » Closed (fixed)

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