Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2007 at 14:07 UTC
Updated:
5 Nov 2008 at 20:24 UTC
While trying to pass a full URL to theme_image, it doesn't show any image.
echo theme_image('http://drupal.org/themes/bluebeach/logos/drupal.org.png');
So I looked at theme_image(). It seems !$getsize does not work. So I replaced it with $getsize==TRUE.
Now, theme_image works fine.
my system:
PHP 5.0.5-3
Webserver Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_ssl/2.8.22 OpenSSL/0.9.7e mod_perl/1.29
Comments
Comment #1
derhasi commentedIt's not the !$getsize-thing (sure it had to be $getsize!=TRUE) ... it has something to do with getimagesize, I guess.
Comment #2
derhasi commentedNow I found the reason: is_file()! - is_file is not able to work with remote files (full URLS).
so I changed theme_image [line 611 of theme.inc] to:
Now it works, but remote files can get validated.
Comment #3
bdragon commentedbad mojo!
You shouldn't be using theme_image with remote urls, period.
Comment #4
povman commentedIn that case, the documentation is wrong:
$path Either the path of the image file (relative to base_path()) or a full URL.
Comment #5
stella commentedThis is actually a bug. Either the function should accept a full url as the documentation states it can do, or the documentation should be corrected. I'm sure other developers will continue to run into this issue until this is resolved.
As for using theme_image() with remote urls, I'm not. I'm trying to give it the url of a local file - generated using
file_create_url(). This is because I've noticed that with private file downloads, theme_image() generates a path to the file that isn't a system path (e.g. it's not http://mydomain.com/system/files/foo.jpg).Cheers,
Stella
Comment #6
webchickI can confirm this bug.
Comment #7
webchickOk, technically this was earlier, but #238681: theme_image() not evaluating properly? has a patch. Please review.