I've looked thru the forums for an answer on this and didn't find one.

I have found several other posts that appear to have the same or simular problems without positive resolution. :-? There may be others than this that I didn't read. Hopefully getting this to work for me or at least understanding what and why it is not working will help some others as well.
http://drupal.org/node/view/4325
http://drupal.org/node/view/4143
http://drupal.org/node/view/3978

I have installed Drupal 4.3.1 and got it working I then installed the images.module for 4.3.0. Win2k Server running Apache2, mysql 4.0.15, PHP 4.3.3.

for configuring the images.module I used:
Default image path: images/
Default thumb path: images/thumbs/
Temporary image path: images/temp/

I've made sure that these directories exist.

for the image library I use imagemagick Version: ImageMagick 5.5.7 07/22/03

located at: c:/Program Files/ImageMagick/convert.exe

and jhead path of: c:/netpbm/jhead.exe (Yes, its in there)

I have a Gallery Navigation Vocabulary: of "Images"

The status screen fo images is all good:
Below is a status of image module's current configuration.
Default image path OK
Default thumb path OK
Temporary image path OK
ImageMagick convert OK
GD Library available (version 2) - supported formats: JPEG, PNG, WBMP
Jhead OK
Image vocabulary assigned

F:\blogsite\drupal is the docroot for the virtual host http://blog.thetinfoilhat.com

When I attempt to upload an image it appears to work until I get this error message:

warning: rename(images/temp/tmpthumb_65969a52c869c0cf4602e2444b002796.jpg,images/thumbs/thumb_65969a52c869c0cf4602e2444b002796-10.jpg): No such file or directory in F:\blogsite\drupal\modules\image.module on line 697.

followed by the message: Cannot save image.

If I look in these directories I have a file images\65969a52c869c0cf4602e2444b002796.jpg in the directory but no thumb for that file in the thumbs directory and no file in the temp directory.

If I examine the image table in the database it exists but is empty.

The php and Apache error logs have no useful information.

Is there additional information that I can provide you to resolve this problem? Please provide information or instruction for me to test troubleshoot or repair.

I'd like to stop banging my head on the wall now and move on to some other problem or perhaps adding some of the other stuff. Image storage is kinda a base requirement, and until I have a working system that will store and use images I can't use Drupal. Any help would be much appreciated.

Al

Comments

Icarus-1’s picture

Additional Imformation is located in forum: http://drupal.org/node/view/4438

MuratMetu’s picture

I think the problem originates from your image magick configurations.
Check clearly if the "_image_convert($source, $dest, $filter)" function
executes with no error. If it does not work correctly when you are uploading
file you face with exactly the error you mentioned.

If you are working under windows machine

remove
$err = exec("$_imagick_convert $filter $source $dest");
in _image_convert function

add
$err = my_execute($filter,$source,$dest);

and define function

function my_execute($filter,$source,$dest)
{
//$test=`D:\Web\drupal\bin\a11.bat $filter $source $dest`;
$test=`D:\Web\drupal\bin\convert.exe $filter $source $dest`;
//Your path to image magick convert.exe

if(exec($test))
return TRUE;
else
return FALSE;
}

you can use bat files in this function.

Murat Ali Bayır
Department of Computer Engineering, METU
MS student at Ceng,
BS student at Math,
Mail: muratmetu@yahoo.com

Icarus-1’s picture

Thank you for your suggestion.

I tryed this and it did not work.

I have also tryed moving convert.exe inside the docroot and several other things.

The problem is that convert is not being executed I believe.

As all of imagemagick is in my path and I can execute it from any command prompt without a path why wouldn't the Apache/PHP call get it as well, I do remember running perl that way a long time ago. I have tryed just convert with no path and that didn't work any better. If I can run convert.exe from the command line why wouldn't this php call to convert work the same? Am I missing soething?

Is there a good way for me to force the text of the convert call either to the webpage or to a log file?

What can I do to debug this?

Thanks again
Al

bruno’s picture

Just wondering... Could you try to put convert.exe in a directory which doesn't contain a space in its path, i.e. c:\convert.exe or c:\imagemagick\convert.exe?

Icarus-1’s picture

Ok, maybe found part of the problem, Win2k delivers a program called convert.exe (for upgrading fat filesystems to NTFS) located in the \Winnt\system32 folder.
calls from the command prompt return "Must Specify a Filesystem". This program is well ahead of any other convert in the system path. While this shouldn't matter when calling the convert program (that we want) with a path I'll make sure that there isn't any possibility to get the wrong program.

I copied convert.exe in the imagemagick folder to convertimg.exe for all these tests I used that coppied file.

Just in case there is something odd about the pathing or the way that the pathing is different between *uix and Win or how php is handling it I'll try it both ways.

I've tried:

c:\Program Files\ImageMagick\convertimg.exe
c:/Program Files/ImageMagick/convertimg.exe
c:\Progra~1\ImageMagick\convertimg.exe
c:\PROGRA~1\ImageMagick\convertimg.exe (8.3 name for folder with no spaces)
c:/PROGRA~1/ImageMagick/convertimg.exe

outside the docroot with no space in name (on the same drive)
F:\blogsite\convertimg.exe
F:/blogsite/convertimg.exe

the docroot for the site
F:\blogsite\drupal\convertimg.exe
F:/blogsite/drupal/convertimg.exe

F:\convertimg.exe
F:/convertimg.exe
convertimg.exe

I get the same results. The image.module does not appear to be calling convertimg.exe.

If I execute convertimg from a command prompt from F:\blogsite\drupal (docroot for the site) I always get back the help for imagemagick convert.exe listing all the options and paramaters.

What would you like for me to try next?

Is there some way for me to force the image.module to log its self to a file or even to the webpage?

Al

bruno’s picture

Assigned: Unassigned » bruno

Mmmh, I did some tests on my side on a Win2K box with a small test script that take some code from image.module.

It seems, on the Win2K box, that:
- any space in the 'convert' path is causing problems,
- any output message returned by 'convert' is not catched by the exec() function.

To get a better understanding of what's going on on *your* configuration, could you try to run the following script on your system?
It should be placed in the root dir of your drupal installation along with a test image, called 'test.jpg', and your browser should point to http:///convert_test.php
If it returns 'error: Imagemagick: convert returned an error.', you should have a look to your apache log file.

convert_test.php

Thanks.

bruno’s picture

should read: ...your browser should point to http://<your drupal base>/convert_test.php ...

Icarus-1’s picture

I downloaded the convert_test.php and put it in the docroot for drupal.

I copied a jpg image also to the docroot and renamed it to test.jpg.

When I go to the URL http://blog.thetinfoilhat.com/convert_test.php all I get is a blank page.

The apache log shows nothing. I increased the logging level to "notice: from "error" in hopes of getting more. I'll turn it up to debug for a short period if I need to.

The php error log gives me:

[07-Dec-2003 17:36:21] PHP Fatal error: Call to undefined function: variable_get() in F:\blogsite\drupal\convert_test.php on line 15

When I looked at the code I noticed;

include_once("includes/bootstrap.inc");

(I'm only guessing but perhaps variable_get() is in it.)

There is no file "includes/bootstrap.inc" should I have this? If not where can I get it? :-)

Al

bruno’s picture

Sorry. I forgot you are running 4.3.0. Get the new convert_test.php and let me know how it goes. Thanks.

Icarus-1’s picture

Here you go:

convert: c:\progra~1\ImageMagick\convertimg.exe
source: 'test.jpg'
dest: 'test_out.jpg'
filter: -scale 640x480 -filter QUADRATIC
error: Imagemagick: convert returned an error.

Apache Log File: Nothing
PHP error Log: Nothing

Extra Credit: I tryed the program from the command line from within the site's docroot as:

c:\progra~1\ImageMagick\convertimg.exe -scale 640x480 -filter QUADRATIC test.jpg test_out.jpg

Output was a larger jpg of the same file (Why women don't fix cars). Available at http://blog.thetinfoilhat.com/test_out.jpg no errors.

What does this tell us? Why is apache/php having trouble calling something I can do at the command line with no trouble?

BTW, Thanks
Al

bruno’s picture

There must be something wrong with your installation. BTW, I have on my Win2k test box something different from you: I'm running Apache 1.3 and Imagemagick 5.5.7 is installed in c:\Imagemagick. When running convert_test.php, I'm getting this:

convert: c:/imagemagick/convert.exe
source: "test.jpg"
dest: "test_out.jpg"
filter: -scale 640x480 -filter QUADRATIC

Array
(
)

return: 0
error:

and test_out.jpg is created.

Anonymous’s picture

Wish I could get that result. The only real difference is that I'm runnig Apache 2 then.

I have to admit that I'm more that a bit dismayed that the answer is my server configuration is wrong. Being that it runs near everything I've put on it what would be so different about this module?

What configuration options should I look at and what can I change that will improve the chances that this will work? (That won't break the other sites that are working perfectly on this server now.)

I've just taken a long walk thru the .conf files and php.ini and found nothing that would prevent this from running. That I know of.

Is everyone that is having trouble with module misconfigured? If we are all misconfigured then it must be a problem of common misunderstanding or something very easy to not get right.

Any ideas as to what should I look for? I'm open to sugggestions.

Al

bruno’s picture

One difference it that image module is one of the few modules that calls an external program via the exec() function.

Your last test shows that exec() got an error code, but we are not getting any error message.
I have modified convert_test.php to force convert output to be displayed. Could you try again, please?

I hope we will get more information from this test ;-)

Icarus-1’s picture

Interesting, I got:

convert: c:\progra~1\ImageMagick\convertimg.exe
source: 'test.jpg'
dest: 'test_out.jpg'
filter: -scale 640x480 -filter QUADRATIC

Array
(
[0] => c:\progra~1\ImageMagick\convertimg.exe: Unable to open file ('test.jpg').
)

convert returned: c:\progra~1\ImageMagick\convertimg.exe: Unable to open file ('test.jpg').

The file is available: http://blog.thetinfoilhat.com/test.jpg

The permissions on the file are pretty much wide open to everyone on the server.

Could it be that convertimg.exe needs the full path to the file? I don't know why it would as it is being called from the directory where the file resides and that isn't the behaviour at the command line.

Thanks
Al

Icarus-1’s picture

I was able to recreate the same error message by at the command line typing the worng source file name.

copied convertimb.exe to the docroot of the site
at the command line:
f:\blogsite\drupal\convertimg -scale 640x480 -filter QUADRATIC test1.jpg test_out.jpg

f:\blogsite\drupal\convertimg.exe: Unable to open file .

bruno’s picture

On post #10, you were successful at running convert.exe from the command line. convert.exe was located on C: as well as the test image.

On post #14, where the convert_test.php script was run on a file located on the root of drupal installation, convert.exe was unable to open the test file.

Now, your last experiment tells me that your drupal root is located on a drive F:

Therefore, I can assume that the problem is in relation with files stored on drive F: Permissions on files, permissions on drive? I don't know.

Icarus-1’s picture

There are 22 domains that are currently on drive f: and another 3 on drive d:. Big deal, I want to get another 25 hosted. They won't be on the c: drive. In the first post to this request I posted that the site was on the f: drive and that convert and jhead were on c:, in post 5 I also described the paths that I have tryed by coping the convertimg.exe to them. My prefered path for convert.exe is: c:\progra~1\ImageMagick\convertimg.exe, but I am certainly willing to try other things expecially for testing and to attempt to resolve this issue.

In any case, what possible difference could it make on a windows server? The same user that I was logged on as to try the command line stuff is the same user that the apache server runs as.

The server is running under a userid that has full permissions to all of the directories and all of the files for all of the websites. This userid also has premissions on the c:\program files\imagemagick c:\netpbm and several other directories as well.

If this made any difference then imagemagick and jhead, netpbm, graphvis and such would not work on the postnuke/gallery sites, tikiwiki sites and others. BTW, It does, they do.

I'll try most anything right now to get this module to work, that includes putting a copy of an executable into the docroot of an active website. I don't like it, and it will not be there for any of my procuction sites, but I'm quite happy to try an get this thing to work. My hope was that I was providing you information to better understand the problem, and show you adaquate information to understand that this module not working has nothing to do with the configuration of this server.

I'll happily repeat the test for post 10, and I just tryed it on the copy of convertimg.exe(convert.exe renamed) that I have in the docroot of the drupal site with out it making any difference.

convert: f:\blogsite\drupal\modules\convertimg.exe
source: 'test.jpg'
dest: 'test_out.jpg'
filter: -scale 640x480 -filter QUADRATIC

Array
(
[0] => f:\blogsite\drupal\modules\convertimg.exe: Unable to open file ('test.jpg').
)

convert returned: f:\blogsite\drupal\modules\convertimg.exe: Unable to open file ('test.jpg').

-----
Quite frankly, my post 15 was intended to show you that 1. I'm still working on this problem, and 2. That convertimg.exe wants a full path to the files in the call because it ain't finding the file using the relative paths. Why it isn't finding the files via the relative paths (shrug) I don't know, but being that the webserver can see the .jpg and display it certainly makes me think that it must have something to do with the way that the call is being issued or handled by php/apache2. Tere is any type of permission problem with that file or directory if there was then the url http://blog.thetinfoilhat.com/test.jpg would not give you an image. The file is Full Control to Everyone(group on the server).

I've now had two different people in to review the configuraton of this webserver, both are MCSEs with several years experience between them of webservers both IIS and Apache on windows as well as linux. One works for my provider and the other works for another ISP here in town and neither of them can find a fault with this configuration that would cause this problem.

Thanks
Al

sepeck’s picture

Not sure if this will help or not, but I'll add this information.

W2K3 Server with IIS.
Drupal works though much about the Taxonomy is very new to me (ARG Another 'system' to learn, ah well).

I have a successful Gallery install on the server in a different site. Gallery itself did not work until I gave execute access to cmd.exe to the IIS_Web account. Not liking that for a public server, but still looking at it and Gallery works correctly. (No spaces in any file path per Gallery docs). Gallery seems to call convert.exe through a cmd.exe line call. I have convert.exe in the system32 directory and it finds the correct hard coded convert.exe just fine.

Would prefer to use Drupal and the image module as it makes a much cleaner solution to the future site I hope to put up.

I have encountered this error on trying to upload files from the Create Content images. On the 'Admin Content Image Fast Upload, the same error'
"The specified CGI application misbehaved by not returning a complete set of HTTP headers."

I was finally able to load via the slow upload from a directory local to the server and create Thumbnails, but going past that ended in the CGI error.

Not sure if I any of this information helps, but I am continuing to go through the install and see if I can get anywhere.

Any further details desired, let me know.
speck@blkmtn.org

bruno’s picture

Al,

Thank you for providing details on your configuration, but I'm affraid I won't be able to help you more as I'm unable to reproduce your problem.

I have a Win2K box running Apache 1.3.28, MySQL 4.0.16 and PHP 4.3.4. I'm using recommended ini file for PHP and almost default httpd.conf file for apache. My test site is located in D:\htdocs, while ImageMagick's 5.5.7 convert.exe is in C:\Imagemagick.

I have setup image.module to use convert.exe with the following path: c:/imagemagick/convert.exe, while image path is set to 'images/', thumb path to 'images/thumb/' and temporary images path to 'images/tmp/'.
FYI, image.module does use paths relative to the Drupal installation dir. In my case, Drupal is under D:\htdocs\drupal\, thus image dir is D:\htdocs\drupal\images\.

With this setup, which is quite close to yours, except for Apache, I have *no* problem to upload images or edit existing images.

I see nothing to fix in image.module that would solve what you are experiencing, except the problem with the error that was not reported by the exec() call.

danigiri’s picture

I am having the same problem.

I am using Linux, a pretty plain vanilla RedHat installation, I am using the PHP and Magick that came pre-installed. Invocation from shell results in the thumbnail being created normally. I am using the image module CVS version.

I have modified the exec as follows to checkup on the return code (it seems that the standard implementation does not get the error code at all):

  $array_ = array();
  $err = exec("$_imagick_convert $filter -verbose $source $dest",$array_,$code_);

Echo'ing the return code tells me that the command has not been completed at all (returns 127). Surprisingly, I have been unable to locate an ImageMagick error code table anywhere, have checked the man page of convert, the site, the FAQ, google, no good. There seems to be no table!?!?. The ImageMagick code is gigantic, really.

Permissions problem? I double-checked that... (777), does not look like it is anything so simple, as only the image temp directory is used (the main image is uploaded ok). Definitely non-trivial to solve, given my level of knowledge =). From some google I have inferred that it might be that I have something like 'safe mode on'? This is definitely non-obvious from the docs =). I will try to investigate if I can turn that **** off and post any followups.

Best,

Dani

moshe weitzman’s picture

I just committed a fix for thumbnail generation on Win32 platforms. Please download a new module and verify that all is well. Until the new image.module is packaged for download (up to 12 hours), you may download from here

Anonymous’s picture

Seems to still be broken. FWIW, it fails with the same error whether I use ImageMagick or GD:

warning: rename(./tmpthumb_bridgeview.jpg,images/thumbs/thumb_bridgeview-9.jpg): No such file or directory in z:\web\html\modules\image.module on line 697.

Dunno if it helps any, but the original image _does_ get uploaded correcly into tmp, when you select 'preview'.
Then, if you 'submit', the original gets moved to images, even though the above error occurs.

moshe weitzman’s picture

I just realized that my fix would only affect IIS users. Sorry about the false hope.

My one other suggestion is to play around with Bruno's convert_test.php script and try out your paths with various combinations of double quotes, single quotes, and no quotes around the $source/$dest paths. That is one difference I see between your reports and bruno's.

Also, when calling convert.exe from the command line, make sure you do so from the drupal root directory. and make sure you are calling the source and destination files just like drupal does (including quotes). you might just be able to reproduce the failure in the command line.

you could also try to wrap the $source and $filter params in realpath() function before calling convert.exe. This should cause a full path to be passed to convert.exe

i don't think this is related to file permissions.

-moshe

Icarus-1’s picture

Sorry I've been out of action for a few days, I'll test tonight.

Thanks
Al

patman’s picture

(#22 was posted by me - I have an account now!)

convert_test yields the following:

convert: z:/imagemagick/convert.exe
source: 'test.jpg'
dest: 'test_out.jpg'
filter: -scale 640x480 -filter QUADRATIC

Array
(
[0] => z:/imagemagick/convert.exe: Unable to open file ('test.jpg').
)

convert returned: z:/imagemagick/convert.exe: Unable to open file ('test.jpg').

mikemc’s picture

Not to rush anyone, but I'm having this same problem as well. I tried running your convert script posted above, but I get all this CVS stuff, nothing like what I was expecting. Is there any update on this problem?

mikemc’s picture

I'm wondering if ImageMagick, not being installed as root, and lacking the environment variable settings could be causing this problem. I was able to get the command line to work, exactly as the image.module was calling exec() with, in the ssh session that I used to install ImageMagick. I later had a ssh session open to do some other work and it failed when I tried to repeat the process above because none of the imagemagick session variables were set.

I didn't see anything on the imagemagick site stating that you had to be root to install it, but I'm guessing this is the problem...

jaddison’s picture

I am having this very same problem... Has there been any updates regarding this?

I am running Apache 2, MySQL 4, Drupal 4.3.x, PHP 4.3.2, and image_magick 5.5.7. I only recently installed Drupal - first time, and I like it so far, except for this image module bug/issue. If we could resolve it, that would be fantastic.

If I run it on the command line:

/usr/bin/convert -scale 640x480 -filter QUADRATIC test.jpg test2.jpg

I get:

Illegal instruction

as the output. Perhaps it's an ImageMagick problem? or, I'm not using the proper syntax with 'convert'. Please, let's figure it out! :)

Thanks everyone! Awesome product so far!

jaddison’s picture

Well, GD works, but the script times out (30 seconds).

What should be done is add in support for php_imlib. now THAT'S an imaging library. it kicks ass. fast, and it gives quality results.

Icarus-1’s picture

addi,

the "Illegal instruction" error that you are getting is most likely caused because there is a program convert.exe that is in your path earlier than the imagemagic convert.exe.

The windows convert.exe program is there to convert FAT volumes to NTFS. if you are already NTFS then you can rename that convert to something else or rename the imagemagic convert to somethjing elese and this error will most likely go away.

I'm still hoping for an answer as well because I think that Drupal would be the best choice for some of the things that I want to do.

GD does work, but the thumbs aren't as good and GD won't thumb gif files (if I remember right).

From what I'm seeing it looks like all of the people having this problem are using Apache 2.

Al

abelware’s picture

Folks:

I am running Image.module 4.3.0 on Apache/1.3.27 (RedHat 7.2, ImageMagick 5.5.7) and am having the exact same "No such file for directory . . . error on line 697" problem as some others here. I have done all the same debugging, added lots of debug code all over the place and the call to ImageMagick to create the thumb just doesn't do anything or even return an error for some reason.

GD works fine. I have installed Coppermine, Gallery and Exhibit Engine and they all work fine with ImageMagick -- I am stumped.
---
Ben

Icarus-1’s picture

Gallery and Coppermine work perfectly for me as well on a win2k server abelware. Why would Imagemagic work perfectly on other sites on the same server same drive and not on my drupal site?

I still don't get it either. :-(

judah’s picture

i think i found the problem. like everyone here i have to get this working to get further on with my project.

i was getting the same rename error that everyone else was plus the other crazy errors here. (i didnt know php until this problem forced me to). there is one thing that is absolutely positively true almost 99% of the time when you are debugging code. ...the error messages do not lie... never forget. (i'm emphasizing this because you can waste so much time if you forget).

one of the errors was, "warning: rename(./tmpthumb_bridgeview.jpg,images/thumbs/thumb_bridgeview-9.jpg): No such file or directory in z:\web\html\modules\image.module on line 697."

i printed out all the paths that were being created and they seemed right so i checked the function calling them, "rename" and i found some interesting information on it (http://us2.php.net/manual/en/function.rename.php). read the user comments. apparently it is very picky.

so rather than waste anymore time i ran "ImageMagick-5.5.7-Q8-windows-dll.exe" again and set the install path, to, "D:\ImageM" (D drive is my winnt install drive). i chose the root directory on my hd and set it to less than 8 characters in length for a few reasons. one - from reading the other comments posted here, two - from frustrating past experiences, three - well who cares. i installed it in that directory and went back into Image Site Configuration and set the directory to "D:\ImageM". tested it again and it worked.

the image nodes show up on the front page. showing the image and all.

some problems still remain:
- the "photo gallery (http://localhost/drupal/?q=image/uid/1)" link goes to a page that says, "Access Denied
You are not authorized to access this page." even though permissions are set for me (user id1 - admin).
- the "My Photo Gallery" link (http://localhost/drupal/?q=image/uid/1) takes me to the same page as above.
- the Image > Site Configuration > Gallery Navigation Vocabulary: still contains no contents.

- judah

i am using:
winpro 2003 sp4
apache 2.0.39
PHP Version 4.2.2
ImageMagick-5.5.7-Q8-windows-dll.exe - http://www.imagemagick.org/www/archives.html
- i dont know if GhostScript is required but somewhere along the way I thought it was.
ghostscript - gs813w32.exe
ghostscript view - gsv46w32.exe

judah’s picture

this line, "i installed it in that directory and went back into Image Site Configuration and set the directory to "D:\ImageM". "

should be, "i installed it in that directory and went back into Image Site Configuration and set the Imagemagick Convert path to, 'D:\ImageM\convert.exe'."

there probably some other things i left out too. must-get-food...

abelware’s picture

OKAY!

This is what worked for me . . .

image.module 4.3.0 (not cvs)
Apache/1.3.27
RedHat 7.2
ImageMagick 5.5.7

If I comment out the two calls to _image_escape_shell at lines 962 and 963 the thumbnail is created just fine. As it turns out, with the enclosing single-quotes, the exec() call to convert was failing. So as long as you don't have a single-quote in the filename, you're okay without these two calls. I am using the random string method for filenames, so I don't really care.

I don't know if exec() is adding it's own set of quotes or if convert is belching on the quotes or what. Perhaps, somebody wiser knows?
---
Ben

Icarus-1’s picture

My preliminary testing indicates that commenting out the two calls to _image_escape_shell at lines 962 and 963 in the image.module causes it to work as it should without any other change on my server. No errors, no problems.

My first bit of testing was to simply comment out the two lines and immediately try to upload an image.

The path to convert is: c:\Progra~1\ImageMagick\convertimg.exe (Origional installation directory, C:\Program Files\Imagemagick\ translated to its 8.3 file name) (convert.exe renamed to convertimg.exe) I will experiment with using an unrenamed convert.exe - as installed - unmodified)

I have the option for "Stored Image File Nmaes" set to: "Random String" (and have not yet tested with changing this to use the origional file name. (I will test this as well)

Is there some fix that can be applied to the module that will handle this without having to do this hack this in future?

I will do some more testing as soon as I can later today but this appears to get this module working for me. I will post my results to this support request for future reference.

Thanks to everyone for your help, especially abelware and bruno

Al

Icarus-1’s picture

Stuff I have tried on my server:

Imagemagick Convert path: c:\Program Files\ImageMagick\convert.exe
Did not work, didn't expect it to but it aboslutely did not work.

Imagemagick Convert path: c:\progra~1\ImageMagick\convert.exe
Worked perfectly

I tryed adding images to my personal gallery and to other gallerys via my image taxonomy. It worked well.

I tryed sending pictures with: "Stored images filenames:" set to both random and origional file name. Either worked well.

Thank you to everyone that helped me get this working. Now that it works I'm ready to start working on the next thing.

Thanks again

bruno’s picture

You are welcome. It definitively points out that spaces in the pathnames are not handled properly in _image_convert(), at least for Win32 plateforms. I'll try to cleanup the code there, but it it likely that moving image.module to the new file API should help.

I will mark this issue fixed, but open a new task: Make sure image module invokes shell commands in the right way.

Icarus-1’s picture

Thanks again bruno.

I'll be looking forward to the next version :-)

AL

judah’s picture

the issues i mentioned in my post above:

some problems still remain:
- the "photo gallery (http://localhost/drupal/?q=image/uid/1)" link goes to a page that says, "Access Denied
You are not authorized to access this page." even though permissions are set for me (user id1 - admin).
- the "My Photo Gallery" link (http://localhost/drupal/?q=image/uid/1) takes me to the same page as above.
- the Image > Site Configuration > Gallery Navigation Vocabulary: still contains no contents.

were fixed in an issue unrelated to this issue (my mistake in the cvs version). they are described here if you want to read it http://drupal.org/node/view/5594 or you can simply update to the latest image.module CVS (1.104) to resolve the problem.

gatezone’s picture

Hopefully this is something different giving the same symptoms, but it is frustrating ;-). It just doesn't seem to respond to the ideas and suggestions provided here.

rh 7x, druupal 4.3.2, image 4.3/0

When trying to upload I get the following:

warning: rename(./tmpthumb_5d03b62b1cbc44d2291cab27227edda4.jpg,images/thumbs/thumb_5d03b62b1cbc44d2291cab27227edda4-9.jpg): No such file or directory in /home/virtual/site4/fst/var/www/html/tiva/modules/image.module on line 697.

I've read through the posts in this and the other threads(http://drupal.org/node/view/5680), commented out the code recommended, but couldn't find . Images are uploaded to 'images' directory in the root of the drupal site. I can see the full picture in 'preview' mode but not the thumb. When I hit submit I get the above error message which looks like it is looking for a file or directory. The file exists, the directories exist but it seems like something basic is missing.

I have non drupal "Gallery" working as a stand-alone on server and it works fine with zero problems.

Anonymous’s picture

labyrinthian’s picture

For other people looking for help on this, check out:

http://drupal.org/node/9066

Drupal 4.5 does not (at present) validate the proper installation of ImageMagick resulting in deceiving error messages related to rename. Check your path with your server admin. On Lunarpages, it is /usr/local/bin/convert .

cubano’s picture

Hi. I cannot get image.module (4.5.0) in Drupal (5.4.1) to work with ImageMagick; it works perfectly with gd2, however I need to go with gif files. I have tried everything I read here (proper path to ImageMagick convert file, rights of the tmp, images, thumbs directories, comment the lines calling _image_escape_shell and few other things) however to no avail. I get the very famous:

* Cannot save thumbnail image to images/thumbs/blablabla.jpg
* Cannot save resized image to images/blablabla.jpg

And in the logs:

warning: rename(tmp/tmpimg_blablabla_640x480.jpg,images/blablabla-25_640x480.jpg): No such file or directory en /home/htdocs/www.mydir.com/modules/image.module en la línea 835.

The image is uploaded. I am using SuSE 9.x with ImageMagick 5.5.7 (or similar), anyway testing from the command line: thumb and resized image are produced.

Is there a cause/solution already for this very common mistake?

Other than that, the module is very good. I am using it (with gd2 :-) in another running site. Thanks for your time!

urbanfalcon’s picture

Component: Code » gd toolkit

For me, it was a discrepancy between the filename that was stored during preview and the actual filename. Apparently, one contained both upper and lowercase (the actual filename), and one was just lowercase (the saved filename). When it compared the two, it concluded they were not the same file. Solution?

function _image_make_thumbnail($imagename, $thumbname) {
  $error = '';
  //the filenames being saved in session are lowercase, so if we don't lowercase now
  //then the system will note a discrepancy and explode with rename errors.
  $imagename = strtolower($imagename);
  $thumbname = strtolower($thumbname);

Note the last two lines. I don't know, but it seems to work. I am using GD only and not ImageMagick...it was only pooping out when I previewed and then tried to subsequently submit, but just submitting was always fine. This seems to have taken care of preview...works like a champ now.