Closed (fixed)
Project:
Taxonomy Image
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2009 at 17:47 UTC
Updated:
15 Feb 2013 at 17:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
castawaybcn commentedUPDATE:
I just found out that the error disappears when you change the file download method to "Public - files are available using HTTP directly"
in admin/settings/file-system.
Comment #2
nancydruI don't think I have ever worked on a site with private download, but I will look into what might need to be done - at the very least, an error message.
Comment #3
jerdavisThis is also an issue for hosting infrastructure's with security protocols which do not allow file access via URL. Without this access getimagesize() fails when passed a URL rather than a file directory path.
Please introduce a check for this and fall back to a file-system level read if possible.
Thanks!
Jer
Comment #4
nancydruAt line 268, you will see
Please change it to
And let me know if the problem is solved.
Comment #5
castawaybcn commentedIt worked, the error messages are gone!!
Thanks for such a quick reply!!
PS it was on line 266 however
Comment #6
nancydruGreat, thanks for checking it out for me. I can commit this now.
Comment #7
castawaybcn commentedmy pleasure, thanks for such a quick and effective fix
Comment #8
nancydruCommitted. It's always nice to have someone actually test a fix.
Comment #9
Anonymous (not verified) commentedThanks a lot for the patch, not only the error messages are gone, in our case it also dealt with random displaying-or-not of taxonomy images in lists!
Comment #10
maijs commentedThanks NancyDru, patch in #4 worked!
Comment #11
nancydruIt is now part of the -dev release so it does not need to be patched.
Comment #12
j0rd commentedI'm having issues on a multi-site install, even after the patch #4.
using on line 266:
dpm(array('fulpath' => $fullpath, 'path' => $image[$tid]->path));I get
which still doesn't work.
Comment #13
andypostSame issue if using taxonomy_image_attach module because path stored in image NOT relative to category_image folder
Comment #14
andypostPatch from #4 is a quick fix but problem is deeper
as #437814: Images won't load and site "crashes" after upgrade from 1.5 to 1.6 not duplicate but dependable
Suppose images can be stored in any location but displayed propertly
Another issue with image_attach if term delete so image deletes too but it breaks original image-node
Comment #15
nhck commentedUpon testing the dev-Version w/ the fix above I must mention that this breaks the functionality of loading the default image.
Instead of
It should be
Also the description must be changed, so the users only specify the filename of the default image. If you want to keep this option (a completly different path for the default-category image) the above replacement should read:
Why not url()? Because URL creates language-aware paths which might include a language prefix, e.g. 'en'. You won't be able to load the file from that location.
Comment #16
ñull commentedWhile submitting this fix you did not realise that it was reported as separate bug #454414: failed to open stream: no suitable wrapper could be found. Please look better and fix it in the right issue! I started fixing the duplicate issue and discovered too late that your fix was submtted to dev version already.
Comment #17
pfaocleUpgraded from 1.4 to 1.6 today, hit lots of these messages even after running update.php, using public files.
#4 fixes this, neck-deep in work atm so have not checked this out any further.
Comment #18
hovel commentedI get a warning:
#4 fixes this problem for me. But ...
On the taxonomy_image project page "Development version status" the solution of this problem is refered to as "Support private downloads".
I don't think this has anything to do with either private or public download. Private/public download is abaut how images are presented to the visitor of a website. The access we are talking abaut is direct acces to the image file by a php file function. This should always be done via a path. As my warning message shows, some servers do not allow URL-file access.
Regards,
hovel
Comment #19
mrfelton commentedchange at #4 fixes for me. subs
Comment #20
dman commentedI could replicate the problem described at #15
The 'default image' path is left behind by the new path+filename method.
EITHER always put the default image alongside the rest and only give the filename
OR leave the default image as a special case requiring the full path.
(I favor option A)
but right now, release 1.6 does not behave as described with default images.
(Also - when testing, we need to flush the cache agressively under admin-performance. One failed lookup gets remembered, so it's hard to see when you've 'fixed' it)
Comment #21
richardtmorgan commentedI had this problem. I found that it only occurs when I upload an image with a space in the file name. I.e. 'trees in new forest.jpg' fails, but 'trees_in_new_forest.jpg' is just fine.
Can I suggest that on upload, the file needs to be renamed with spaces replaced by underscores?
Comment #22
mediamash commented#4 fixes the problem on D6
Comment #23
diederik_2mpact commentedsubscribing
Comment #24
weseze commentedsubscribing
#4 fixes the problem
Comment #25
9802008 commentedAfter research on Google came across this in the php help for getimagesize: 'If your image name has spaces in it you will need to use rawurlencode() and NOT urlencode() as this function (at least in 4.3.4) does not accept spaces as + signs.'
So:
Change line 267 in taxonomy_image.module from:
to:
Fixed it for me.
Comment #26
9802008 commentedMy post #25 doesn't work. rawurlencode should only be used on the filename, not on the entire URL.
This is what I did, and it 'seems' to be working OK:
Leave line 267 as:
Rather change line 243 to include rawurlencode only on the filename:
Comment #27
dean.p commentedHi, I was getting this error and none of the fixes posted above worked.
warning: getimagesize(http://www.mydomain.com/sites/default/files/category_pictures/sites/default/files/category_pictures/download-icon.gif) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/virtual/www.mydomain.com/htdocs/sites/default/modules/taxonomy_image/taxonomy_image.module on line 267.download-icon.gif is my default image. I noticed only that image was missing on my page and found that in the above URL, the "sites/default/files/category_pictures" is duplicated. So, I changed:
Line 261 of taxonomy_image.module from
$image[$tid]->url = url($fullpath . $image[$tid]->path, array('absolute' => TRUE));to:
$image[$tid]->url = url($image[$tid]->path, array('absolute' => TRUE));... and the error disappears, my default image now loads.
Info:
Drupal 6.13
Taxonomy Image 6.x-1.6
Comment #28
alesr commentedThis one (#27) didn't work for me.
#4 works OK on Drupal 6.14
Comment #29
EmanueleQuinto commentedThe attached patch implements #4 (tested on drupal 6.14); the code, probably needs, some clean up.
BTW why we don't use image_get_info here?
Side note: if you use the url you can have problems if you use the module in an apache protected site. Moreover with the url (remote file) getimagesize needs to download the file before recovering the info...
Comment #30
nancydruBecause it won't accept SWF files.
Let's see some testing and reviewing on the actual patch and someone mark it RTBC.
Comment #31
vasikesubscribe
#4 fixes the problem
Comment #32
khoomy commentedMany thanks it works for me
Comment #33
psynaptic commentedWe were experiencing this issue with one of my clients' servers (Rackspace) and the patch in #29 fixed the issue for us.
The symptoms were pretty severe! We couldn't load the taxonomy image admin page or the pages where the taxonomy images where being displayed. It would just timeout.
A number of people have now confirmed this works for them so I think it would be safe to commit.
Edit: I see that it's been committed already, thanks ;)
Comment #34
Asoahc commentedHi ...
I got the same issue ... and did some manual fixes in the code ...
The image file path were corrupt builded like
http://<domain>/sites/<domain>/files/category_pictures/sites/<domain>/files/image/file>.jpg).The path part was duplicated. With little debugging I discovered that
$image[$tid]->pathcontains the whole path information. So no path building seems to be necessary.Maybe this issues will be fixed in a newer version.
Regards, aSoahc
Comment #35
nomonstersinme commented#4 worked for me! thanks!
Comment #36
Justin MillerPerhaps make this fix (from #4) a configurable option for the module? I have just run into an issue with a site hanging for a minute or more which turned out to be this line when combined with load balancing after a little research with Xdebug and Webgrind. It would be nice to allow this to be configured.
Comment #37
xurizaemonI am glad that we're accessing the file via the local filesystem, not via HTTP now. Thanks for that - it's a lot more efficient to skip the extra request handling.
I'm afraid that a small fix is still required here, because the module will still show an error (even to anonymous users) if the image doesn't exist, and that isn't ideal IMO.
Checking for the existence of the file is only a partial fix, as the image might be unreadable (permissions) or invalid (corruption). Suppressing the error in case of failure (using the @ operator, eg @getimagesize) is what happens in image_get_info(). That's a simple fix really.
This patch checks for existence of the file. It's fairly trivial so I'll leave it up to the maintainer to change status if this needs further review or discussion. Patch is against CVS 6.x-1.x-dev.
I have no issue with simply making the call
@getimagesize()if that's preferable.Comment #38
xurizaemonScratch that. Setting "needs review" to make sure that NancyDru catches the updated patch above.
Comment #39
dman commented@xurizaemon - are you looking for is_readable() ?
Comment #40
xurizaemon@dman - you're right, is_readable is a better way. Thanks.
Two patches attached - please pick one.
One checks if the file can be read, but will still show errors in the event of corrupted images being uploaded.
The other simply suppresses the error message, as per image_get_info().
Comment #41
robeano commentedHere is a version of the is_readable patch that works with 6.x-1.6
Comment #42
mvcThe patch in #41 worked perfectly for me on 6.x-1.6 behind htauth and with language switching by path prefix enabled. Thanks!
Comment #43
attiks commentedran into the same problem after updating, patch #41 works for me, thanks
Comment #44
stella commentedis readable patch in #40 works for me
Comment #45
Anonymous (not verified) commented#41 works for me, thanks!
Comment #46
zilverdistel commentedsubscribing
Comment #47
ManyNancy commentedSo many patches... Which one do we use?
Comment #48
Anonymous (not verified) commented#41
Comment #49
bricef commentedHello,
When this patch will be applied to this great module. Is there anyone here to maintain it?
Comment #50
srobert72 commentedSubscribing
Comment #51
nhck commentedSo there are actually two people that tested #41?
Comment #52
srobert72 commentedAnd worst, we have this error for nothing !
Image size seems not to be used.
Height and width are never writen in HTML output.
See #707850: Missing Height & Width attributes
Comment #53
mvc@Niels Hackius: yes, see comments #42 and #43 :)
@srobert72: that's an unrelated bug and shouldn't hold up this patch.
Comment #54
mvc@Niels Hackius: yes, see comments #42 through #45
Comment #55
cedarm commented#41 patch works for me as well.
Comment #56
satcom74 commentedPatch #41 worked for me great. Thanks.
Comment #57
skizzo commentedHave been using 6.x-1.6 for a while but saw this error for the first time today.
(all my images are already readable, and I have no spaces in filenames)
Patch #41 apparently fixed it. Tank you.
Comment #58
red18 commentedPatch #41 works a treat. Thanks alot.
Comment #59
tjjacobsen commented#41 on 6.x-1.6 worked perfectly. Thanks much!
Comment #60
joecanti commentedThankyou thankyou thankyou! #41 worked for me too.
cheers, joe
Comment #61
kingandyPatch in #41 works for me too. Can has new release pls?
Comment #62
UNarmed commentedIm going to give this a try now, looks promising though =D
Comment #63
majdi commented#41 works for me on multilanguage website
Comment #64
xurizaemonHave raised this issue with NancyDru directly, she said she'd try to take a look at it today. Thanks Nancy!
Comment #65
timb commentedpatch in #41 works for me on a multisite install
Comment #66
karlschneider98 commentedPatch in #41 worked. Drupal 6.16
Comment #67
karlschneider98 commentedPatch in #41 worked. Drupal 6.16
Comment #68
xurizaemonI think it's clear now that the patch works. We're just waiting on the maintainer to accept it at this point.
It may be that Nancy would appreciate someone stepping forward and offering to co-maintain the module in the meantime - I understand she still has a lot on her plate and her availability to handle contributed module maintenance might be impaired for a while yet. This module is one Nancy adopted from another contributor, and the support of another taxonomy_image user/maintainer would probably be a big help.
If you think you might be able to help, please read dealing with abandoned projects and then put your name forward via #783486: Offers to co-maintain Taxonomy Image. I'm hoping that we won't need to follow the abandoned module process and that Nancy will invite a co-maintainer herself.
NancyDru, if you're following taxonomy_image still, I'm sure many of us would appreciate hearing back from you via that issue to clarify how you feel we can best support you as module maintainer.
Comment #69
nancydruCommitted to 6.x-1.x-dev.
Comment #71
goyal.286 commentedThanks.......
// $img = getimagesize($image[$tid]->path);
$img = getimagesize($fullpath . $image[$tid]->path);
// $img = getimagesize($image[$tid]->url);
it works ..........
Amit
Comment #72
rafaeldwan commentedMaybe a note about this problem in the readme or on the module's page? It was the first thing to happen to me after install, a lot of wasted time would have been saved with a simple "install dev or apply patch from http://drupal.org/node/438378 @41 if you run into this"
Thanks for what I assume will be a great module!
Comment #73
nancydruIs the current -dev stable enough as-is to be an official release? Or do we need some more patches applied?
Comment #74
dman commentedI think I've been using this -dev successfully for a while. Not been pushing at the edges though.
And this being a 'critical' fix on the last 'stable' sorta pushes a release into being a necessary bugfix.
IMO
Comment #75
srobert72 commented@NancyDru
It would be nice if we could include a patch for this simple issue
#707850: Missing Height & Width attributes
Comment #76
aaronbaumanSorry, I'm not sure if I am following this thread entirely.
Does this patch address the issue I'm having of being unable to upload a term image with a space in the filename?
Comment #77
xurizaemonJust closed two duplicates of this, #602716: problem with "Use external image" and #861334: image should only be opened over HTTP if it is external.
@aaronbauman, this fix is in 6.x-1.x-dev already and yes it should fix your filename issues (but you probably already established that, that I'm sure).
@NancyDru, may I suggest a release coordination issue be opened if you're not yet confident of pushing out a new stable?
That way we can discuss whether or not 6.x CVS is ready for prime time without needing to divert this already lengthy thread from its topic.
Comment #78
ak commentedCurrent dev still has problems. I had to change false code around lin 244.
$image[$tid]->url = file_create_url($mypath . $image[$tid]->path);should read
$image[$tid]->url = file_create_url($fullpath . $image[$tid]->path);Comment #79
lipcpro commented#78 works for me
Comment #80
Anonymous (not verified) commentedThanks for that ak, I was tearing my hair out wondering why images weren't displaying!
Submitted a patch for review: http://drupal.org/node/961834
Comment #81
neillodwyer commentedI downloaded the most recent dev version and I've applied that patch as suggested in #78 but the images are still not displaying. It's the first time I've tried using this module. Is there something else I'm overlooking?
Comment #82
GaneshKumar commentedThank you Nancy,
#4 works for me. Great Tips!!!
Comment #83
revagomes commentedPatch in #41 works for me too.
I'm running Drupal 6.17.
Thanks!
Comment #84
asad.hasan commentedKudos for the patches, works like a charm now..
The developer should fix this already
Comment #85
DomP commentedI keep getting this error at 6.20 dispite the patches.. I've try'd several boxes withoy luck.. i think i'm lost ....
Comment #86
alesr commentedHave you tried #4
Comment #87
husumiao-1 commentedThank you so much, man.
Comment #88
corbin commentedone more thanks !
Comment #89
stijnd#41 works perfect for my installation: 6.20
Comment #90
nancydruTake a look at #69.
Comment #91
made4w3 commentedsubscribing
Comment #92
d3str0y commentedI've got the same problem.
getimagesize(path/to/site/sites/default/files/category_pictures/image.png) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in path/to/site/sites/all/modules/taxonomy_image/taxonomy_image.module on line 267.
Comment #93
Nikdhil Mdohfan commentedThis is what i got when i did this ,..
Please try yourself once before you submit a reply..
Comment #94
j0rd commented@nikhilmkumar that's a mysql related error and most likely not related to this problem.
Clear your cache and try again.
You may have a fast mysql connection timeout, or your query size limit is too small.
Comment #95
beto_beto commented#4
i am using 6.x-1.6 taxonomy_Image module
and I have the same issue here
warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in C:\inetpub\vhosts\********.com\httpdocs\sites\all\modules\taxonomy_image\taxonomy_image.module on line 267
Where i should make this changes ?? on what file or folder ??
thank you
Comment #96
beto_beto commented#4
i am using 6.x-1.6 taxonomy_Image module
and I have the same issue here
warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in C:\inetpub\vhosts\********.com\httpdocs\sites\all\modules\taxonomy_image\taxonomy_image.module on line 267
Where i should make this changes ?? on what file or folder ??
thank you
Comment #97
beto_beto commented#4
Thank you , i got it now and it worked for me thank you :D
Comment #98
vb_swapnil commentedThanks, It worked for me