That's because the image style function (http://api.drupal.org/api/drupal/modules%21image%21image.module/function...) always creates the full url to the image.
There's a bigger irony here. In case the image style has not been created yet, this test will also fail, so we should strip off the 'styles/public/style_name' off as well.
Patch coming up.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | dummyimage_missing_1728026-5.patch | 593 bytes | shiraz dindar |
| #3 | dummyimage_missing_1728026-3.patch | 689 bytes | frjo |
| #2 | 1728026-2.patch | 667 bytes | naxoc |
| #1 | 1728026-1.patch | 850 bytes | swentel |
Comments
Comment #1
swentel commentedWe need a strategy as well to strip of the style name, so the patch definitely needs work, but setting to 'needs review' to get some attention.
Comment #2
naxoc commentedYou are right. The code is a relic from the D6 and will never work.
The check for the existence of the file should be on the actual path and not the derivative. Here is a patch that uses a (horrible) regexp to get the path. It works, but it is not pretty.
I am not super sharp on stream wrappers so please take the patch for a spin and see if you can shoot it down.
Comment #3
frjo commentedHere is my patch for this problem. I believe it will work for public, private and any other schema as well.
Comment #4
naxoc commentedI committed the patch from #3 with a small change.
This took way too long. Sorry about that. Will try to make a release a soon as possible.
Comment #6
shiraz dindarI had a situation where filenames had colons in them. These are considered legit by the filesystem but drupal urlencodes the filename, and thus are unmatched when checked by the missing images option (always fails). Here's a simple patch to urldecode() the filename.
I've also switched to file_exists from is_file because is_file can return false when the file acctually exists (see: http://stackoverflow.com/questions/12173865/php-is-file-always-return-false). file_exists is the correct function to use here.
Comment #7
shiraz dindarComment #8
shiraz dindarComment #9
shiraz dindarI used the wrong comment number in the patch name, but you get the idea.