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].
Comment | File | Size | Author |
---|---|---|---|
#1 | image-hyphens_in_style_names_fail-818686-1.patch | 680 bytes | CrookedNumber |
Comments
Comment #1
CrookedNumber CreditAttribution: CrookedNumber commentedComment #2
CrookedNumber CreditAttribution: CrookedNumber commentedComment #3
CrookedNumber CreditAttribution: CrookedNumber commentedComment #4
aspilicious CreditAttribution: aspilicious commentedlooks fine can someone test this code?
Comment #5
andypostThis could be tested after #606598: Human readable image-style names
Comment #6
AaronBaumanconfirmed bug.
verified patch #1 fixes it.
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.