Hi, I see a lot of watchdog errors concering getimagesize. The path is wrong, I get getimagesize('/category_pictures/test') which of course fails the important part "sites/default/files".

In taxonomy_image.module, line 267, I changed:

$img = getimagesize($image[$tid]->url);

to:

$img = getimagesize(file_directory_path().$image[$tid]->url);

And the errors went away.

Am I doing something wrong, or is this a bug? I'm working on a localhost environment, but I never have Drupal path issues.

Comments

greta_drupal’s picture

I have now experienced this failure as well -- taxonomy images no longer show and error messages generate -- since updating core to 6.17 and contributed modules to the latest ImageAPI, ImageField, ImagefieldCrop (up from previous versions). The URLs definitely are not writing to include the /sites/default/files path prefix.

Even though I did try morningtime's fix, it did not resolve for me. Besides, you shouldn't have had to add that $img = getimagesize(file_directory_path().$image[$tid]->url); as it is already stated in the variables called by line 267:

  // Get base path for my images.
  if (!isset($mypath)) {
    $mypath = variable_get('taxonomy_image_path', 'category_pictures') .'/';
    $fullpath = file_directory_path() .'/'. $mypath;

Also, changing the image processing to "ORIGINAL" in order to bypass ImageCache had no affect, nor did disabling the ImageCache module altogether.

greta_drupal’s picture

Moreover, the install file states:
Go to "administer >> settings >> taxonomy_image" to configure the module.
If you properly followed Step 0 above, this module will automatically create
the 'picture image path' which defaults to 'files/category_pictures'. You can
also configure the module to force pictures to be within a certain size,
automatically resizing if needed.

In any case, when I tried creating that second "files" subfolder and moving the "category_pictures" folder there, it did not correct the above-noted problem.

Also, since most people will have a file system directory of /sites/default/files, making the taxonomy images default path files/category_pictures adds a redundancy. Moreover, it makes better sense for clarity to simply name the containing folder taxonomy_images. So, the full path default path (with typical file system config) would be: /sites/default/files/taxonomy_images

Anonymous’s picture

So it should be something like this?

$img = getimagesize($fullpath.$image[$tid]->url);

Because I think $fullpath is the missing part then.

moonray’s picture

Seems like the line to fix would be line 243. This would be consistent with the code on line 261.

from:

      $image[$tid]->url = url($image[$tid]->path, array('absolute' => TRUE));

to:

      $image[$tid]->url = url($fullpath . $image[$tid]->path, array('absolute' => TRUE));
alexpott’s picture

I was having this issue too...

I changed line 261 to:

  $img = getimagesize($fullpath . $image[$tid]->path);
noslokire’s picture

Did #5 but on Line 267, not 261 and its back

pvanderspek’s picture

I just upgraded CCK, Date, Filefield and Webform and right after that I started getting this error as well. Strange thing is that sometimes it works and sometimes it doesn't. I have a table with one of three taxonomy images per row. All three images are shown throughout the table, but on some rows no image is displayed. I have a long list with alternately these two errors in the drupal-logs:

getimagesize() [<a href='function.getimagesize'>function.getimagesize</a>]: URL file-access is disabled in the server configuration in ............/sites/default/modules/taxonomy_image/taxonomy_image.module op regel 267.
getimagesize(http://www.......nl/files//category_0) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: no suitable wrapper could be found in ................../sites/default/modules/taxonomy_image/taxonomy_image.module op regel 267.
pvanderspek’s picture

Priority: Normal » Major

Updated priority as it really is not ok that images are seemingly random displayed or not.
Perhaps this issue is related: http://drupal.org/node/438378

simon georges’s picture

Status: Active » Closed (duplicate)

Hi.

I can confirm #6 (I did #5 on line 267, and the images are back for me).
I agree that this is a duplicate of #438378: function.getimagesize error. It seems the bug is fixed in 6.x-1.x-dev. So I closed this one.

Best regards,