Posted by CrookedNumber on June 4, 2010 at 8:56pm
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | image.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | CrookedNumber |
| Status: | closed (fixed) |
Issue Summary
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()
<?php
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].
Comments
#1
#2
#3
#4
looks fine can someone test this code?
#5
This could be tested after #606598: Human readable image-style names
#6
confirmed bug.
verified patch #1 fixes it.
#7
Committed to CVS HEAD.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.