I was able to get the image module working on two other Debian boxes but am having problems this time.
It a Redhat 6.2 box (don't ask,), a 4.3.x of drupal install, and ImageMagick. When I submit an image I get this error: "warning: Rename failed (No such file or directory) in /home/ftponly/chainworkers/html/dev/modules/image.module on line 697."
But when I only preview the image, the image is upload but a thumbnail is not created. I thought it was a problem with convert but it works when I call it from another script. The status screen (administer->image) says the status for all options is okay and the directories' premissions are 775. I'm not getting any error messages and not sure where else to look. Can someone point me in the right direction so I can debug this?

Comments

Nick@usu-lug.org.ru’s picture

I have the same in 4.4 and cvs version of module and 4.4.1 version of Drupal.

methoxy’s picture

I am struggling with the same issue here (Drupal 4.4.1). I've checked all paths and permissions several times, and it does not seem to be a problem with ImageMagick either, as it works fine from commandline.

Anonymous’s picture

So this is clearly a problem.
Who do we kick/nudge/etc to get a response and a fix?

judah’s picture

I had the same problem. Try this first. On the directories you've selected for your thumbnails and images set the permissions to read, write and execute on owner, group and other. I don't know if this is unsecure or whatever. I used WS-FTP to set this on a directory but it says it's the same as using chmod on *nix. If that works for you then someone needs to update the instructions file for future reference. Or modify that image module validation screen to see if the directory has read/write permissions and give an accurate error message.

Anonymous’s picture

I tried setting all the directories (image, thumbnail, and tmp) to 777 and it still didn't work, or give me an error message other than the one above.

judah’s picture

I have it working on my site and helped pay to get it finished, so let's debug this till we figure out what it is.

Try this. Do you have your thumbs directory under your images directory, "images/thumbs"? Move the thumbs directory out to the same level as the images directory. Apply the permissions and try it again.

Default Image path
images/

Default Thumbs path
thumbs/

Temporary Image path
tmp/

Stored images filenames:
random string

Imagemagick Convert path:
/usr/local/bin/convert

Gallery Navigation Vocabulary:
images

Also what version of image.module are you using?
I am using the one from "\contributions\sandbox\gordon\image.module". This is version 1.15. The one on the site under "\contributions\modules\image" is v1.14.

What type of file are you trying to upload? Gifs are not supported. This is an easy thing to miss. I wish it did upload gifs. Even if they didn't have any options applied at least they could still be used. But as is gifs (and other common file formats) are not supported.

Report what works here. If you have a way to diff two documents we may be able to figure out what has changed.

judah’s picture

I forgot to mention. The image module was updated to support the new htmlarea module. The htmlarea and image module was updated to add image upload capabilities right from the htmlarea. So if you install the newest htmlarea and image module (granted you get it working) you can press the image toolbar button and on the popup screen you will see a "upload image" section that will allow you to upload images and then select them to be inserted directly into your htmlarea. It is really slick when it works. I have it running on my site now (munkybred dot com). You can create an account and test it.

methoxy’s picture

Thanks for the advice, but I've tried everything (changing the thumbnails path, changing the module version to 1.15 etc) and it still doesn't work.
It always hangs at the following point:

// Rename Thumbnail
if (!rename(_image_tempthumbname($node), $node->thumb_path)) {
die(t("Cannot save image."));
}

In v1.15, that's line 787. Again, I'm using drupal 4.41.

Anonymous’s picture

It seems that the temp image is created. However the temp_thumb image not. So the following error is correct:

warning: rename(tmp/tmpthumb_fd7a2c9c29fd3962afc288c0d0e1aad4.jpg,thumbs/thumb_fd7a2c9c29fd3962afc288c0d0e1aad4-33.jpg): No such file or directory in C:\drupal-4.4.0\modules\image.module on line 737.
Cannot save image.

Cause the image.module can not rename a temp_thumb that does not exists.

Now my question ... how to resolve this problem?
I work with windows 2000 server. Suggestions of working platform or better code?

replys and mails granted
erwin@computerarts.be

Anonymous’s picture

I am getting these same symptoms on my drupal 4.4.1 install. I'm using Linux and ImageMagick. Has anyone resolved this yet??

cruss’s picture

I have a resolution. For all of those who have tinkered and toiled with this, I have solved it for myself and I believe this will help others. Please note that this is on a Linux Installation. I do not believe it applies to windows users.

OK, so I was having the same problem as everyone else. Using ImageMagick in the image.module. There is an upload of the image as a temp img but no thumbnail creation and therefore no successful uploading of images into the database.

This was so hard to fix because it is TWO separate issues that give the same symptoms. Some may be suffering from only one of them, but from the postings I have read (this is a really wide spread issue) many seem to be suffering both.

****actual answer starts here****
The fundamental issue is that PHP is set to not allow execution of anything via the exec() command unless it is in a specified directory in the php.ini file (safe_mode_exec_dir). Mine was set to /usr/local/share/php/bin/ so it couldn't execute the convert command because it wasn't in there. I made a symbolic link from the actual install point to that directory. (ln -s /usr/X11R6/bin/convert /usr/local/share/php/bin/convert). Then PHP was able to successfully run the convert command. But the problem still persisted. I then tried the suggestion on many of these threads to comment out the $source = _image_escape_shell($source); and $dest = _image_escape_shell($dest); lines in the _image_convert function in the image.module file. These seem to cause a problem with the exec() command and should be tested and updated.
****End answer****

This should be included in the install documentation and possibly a test case in the tests that the administer >> images node runs.

Thanks for all the time everyone spent on this, I couldn't have solved it without the volume of postings from other users.
as a first encounter with drupal and the drupal community, I'm very glad to be here.
CR
P.S. I'm going to cross post this with the forums so as many people can find it as posable.

chx’s picture

I had two problems:

1) Description should not be empty! It's the node title which is mandatory.

2) Upon success, it does not close the popup and inserts the IMG tag, just returns with the home page 'Status: image created' (may not be exact text, I'm using a localized version).

cornernote’s picture

Title: Upload Fails (Doesn't Produce Thumbnails?) » I Fixed It On My Windows System

Hello,

In the _image_convert function I changed this:
return $err;

To this:
return t("$_imagick_convert $filter $source $dest");

It returned the Image Magick command that was trying to run. Aparently it does not like the quotes around the file names. To remove them do this to the _image_convert function:

CHANGE FROM:
$source = _image_escape_shell($source);
$dest = _image_escape_shell($dest);

CHANGE TO:
$source = strtr(_image_escape_shell($source),array("'"=>""));
$dest = strtr(_image_escape_shell($dest),array("'"=>""));

Hope this helps some people.

Best regards,
Brett

Mr PHP :: We Create Code

jonbob’s picture

Title: I Fixed It On My Windows System » Upload Fails (Doesn't Produce Thumbnails?)
aletheia-1’s picture

I finally found those lines in the image.inc

I changed them to what you all suggest, but it hasn't worked either.

Any update on this subject?

thanks!

Anonymous’s picture

still having same problem here. tried all the suggestions

Anonymous’s picture

Nevermind, i figured it out. I had to change the Imagemagick convert path to /usr/X11R6/bin/convert from the default path, since I'm on a hosted redhat server and not Winders. Thumbnails work great now. :)

Anonymous’s picture

Title: Upload Fails (Doesn't Produce Thumbnails?) » FIX: Upload Fails (Doesn't Produce Thumbnails?)

GEEZ!!

I had this problem a freakin' year ago...

http://drupal.org/node/4453#comment-5022

To fix it now in v45.2 :
Modify line 100 of image.inc, removing the call to _image_escape_shell().
Comment out the calls to _image_escape_shell() at lines 316 and 317 of image.inc.

Just make sure there are nospaces in your image names. If you use the random option, it doesn't matter.

Ben

drewish’s picture

Version: » 4.6.x-1.x-dev
Component: Code » imagemagick toolkit
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)