My site hosting has recently updated PHP engine to the version 4.4.1. From this update i can't use properly the image.module. The module can't create anymore thumbnails/preview. The PHP error is

imagejpeg(): Unable to access files/images/vid.thumbnail.JPG in xxxxxxx/includes/image.inc in line 296.

I'm using Drupal 4.6.3 e image.module 4.6.0

Any issue for solving this problem? Thanks for help.

Katapekkia - community blog/forum

Comments

psicomante’s picture

perhaps the problem stay here:

        $source = file_create_path($node->images['_original']);
        $destination = _image_filename(basename($source), $size['label'], $temp);
        if (!image_scale($source, file_create_path($destination), $size['width'], $size['height'])) {
          drupal_set_message(t('Unable to create %label image', array('%label' => $size['label'])), 'error');
        }
        else {
          $node->images[$size['label']] = $destination;
          if (!$temp) {
            _image_insert($node->nid, $size['label'], file_create_path($destination));
          }
        }
      }

Here the changelog of PHP 4.4.1
http://www.php.net/release_4_4_1.php

In particular:

Fixed an issue with trailing slashes in allowed basedirs. They were ignored by open_basedir checks, so that specified basedirs were handled as prefixes and not as full directory names.

Fixed multiple safe_mode/open_basedir bypass vulnerabilities in ext/curl and ext/gd that could lead to exposure of files normally not accessible due to safe_mode or open_basedir restrictions.
Bèr Kessels’s picture

Category: bug » support
alexmc’s picture

Has anyone got a solution for this? I seem to have a very similar problem.

psicomante’s picture

Priority: Normal » Minor
Status: Active » Closed (won't fix)

The problem was in the php engine, version 4.4.1.

http://bugs.php.net/bug.php?id=35084

johnmc-1’s picture

The correct bug info is here: http://bugs.php.net/bug.php?id=35246

It is still not corrected in a release. For now, the file needs to be created first by using the touch() function.

neoliminal’s picture

I edited my image.module as follows:

        $destination = _image_filename(basename($source), $size['label'], $temp);
        touch($destination); // ADDED THIS LINE TO GET IT TO WORK.
        if (!image_scale($source, file_create_path($destination), $size['width'], $size['height'])) {
          drupal_set_message(t('Unable to create %label image', array('%label' => $size['label'])), 'error'
);

Now I'm getting Warning: getimagesize(): Read error! in /var/www/html/drupal/includes/image.inc on line 89.

Will figure that out next.