I am building a site and I have the root directory protected with an .htaccess file. The taxonomy image module uses the complete url to the image when getting the size of the image (on line 267 of taxonomy_image.module) which breaks since it can't get to the image without a username and password. I notice that you've commented out line 266 which uses 'path' instead of url. Does 'path' work? Can I just uncomment that and comment out line 267? Thanks for your help.

CommentFileSizeAuthor
#1 taxonomy_image_469434.diff1.59 KBdalin

Comments

dalin’s picture

Title: Breaks when used on .htaccess password protected site » Error with getimagesize when used on a site that has HTTP authentication
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.59 KB

Here's a patch that alters things to use relative URLs instead of absolute. This has the added advantage of making getimagesize() check a local file rather than executing an HTTP request to the site - something we definitely want to avoid in high performance situations.

daniel wentsch’s picture

Thanks a bunch, helped me getting rid of those nasty error messages on dev sites that are usually htaccess protected.

Hani’s picture

Hi,

The best way to do this is by replacing
$img = getimagesize($image[$tid]->path);
To
$ img = getimagesize($fullpath . $image[$tid]->path);

This will fix allow_url_fopen been disable in the server, and its more faster.

Sorry, first post (-:

steven jones’s picture

This is causing issues in shared environments too: #811192: getimagesize: Connection refused

steven jones’s picture

Version: 6.x-1.6 » 6.x-1.x-dev
Status: Needs review » Active

Looks like this has been fixed in the latest dev version? Can anyone confirm?

intyms’s picture

i also had this error "HTTP request failed! HTTP/1.1 404 Not Found in ...taxonomy_image\taxonomy_image.module on line 267."
I use public download method.

After upgrade to the latest dev, error disappeared.

tchurch’s picture

The dev version seems to fix my issue #811192: getimagesize: Connection refused too (although I don't need module anymore).

steven jones’s picture

Status: Active » Fixed

Fixed then.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.