Using the same basic configuration as I described in my last issue (which was very promptly addressed--Thanks!), I tried to rotate an image. I got a double error like this:
* warning: rename(C:\path\to\tmp\acidfree\ima2C5.tmp.jpg,private/working/0/6_large.jpg) [function.rename]: File exists in D:\path\to\drupaltest\modules\contrib\acidfree\image_manip.inc on line 106.
* warning: rename(C:\path\to\tmp\acidfree\ima2C6.tmp.jpg,private/working/0/6_small.jpg) [function.rename]: File exists in D:\path\to\drupaltest\modules\contrib\acidfree\image_manip.inc on line 106.
I think the permissions on the tmp folder are fine. After trying to rotate several pictures, that tmp folder is full of rotated pictures--one small and one large of each. One odd thing: the pics that are still in that tmp folder appear to be rotated the opposite direction of the way I indicated with the dropdown menu. What am I doing wrong to provoke these errors?
Comments
Comment #1
vhmauery commentedwhy don't you take a look at the latest 4.7 Acidfree and see if it is working any better for you. Also check to make sure that your filemanager 'private' dir is a subdir of the drupal 'file system path' directory.
Comment #2
g.philippot commentedI was encountring the same trouble on my server (Windows 2000, Apache 2, PHP 5)
it appeare when you are not using exiftran or jpegtran.
After half a day debugging acidfree and looking in forum, I found that the rename function doesn't work under windows if destination file existe. (cf http://fr2.php.net/manual/en/function.rename.php )
so I updated the source code, as follow, in image_manip.inc to manage this case.
Rotation are now working without error but rotation are reversed.
counterclockwise act as clockwise and clockwise as counterclockwise
I will continue to investigate this and post a new topic when I found Why.
Gaël
Comment #3
g.philippot commentedSorry, after checking my code I found that my update is working but I was allways geting the error in drupal log.
Rename error are catched by the drupal error management function before my error management.
so I updated the code as follow.
No more error now.
I also added a '360 - ' operation in image_rotate($image, $outfile, 360 - $angle)) {
to correct the clockwise/counterclockwise trouble. it work well now but I haven't investigated the real image_rotate trouble (the rotation angle asked is correct but not correctly managed).
I am new to drupal, so if my error handling is bad let me know.
Gael
Comment #4
vhmauery commentedg.philippot,
Just for future reference, a unified diff is much more useful to me and easier to read. Rather than posting a huge chunk of code, post the output of
(assuming that acidfree.module is the file you modfied and before you modified it, you copied it to acidfree.module.orig). The resulting text is what is affectionately called a unified diff, or a patch.
I would say the best solution to this problem would be to 1) not use windows and 2) not use GD. But that would be out of line. So I will try and work with you on this one. Give me some time and I will try to roll out a patch that should remedy your problems. I am glad you tracked them down for me.
Comment #5
vhmauery commentedOkay, I have committed a patch that should fix the file rename problem. Instead of using rename, which evidently is not platform independent, I changed it to use the drupal file handling wrappers -- namely file_move and file_delete. This fix is in image_manip.inc version 1.7.2.1 and should be in a repackaged tarball in 12 hours or so.
As for the rotating the wrong way, that is not Acidfree's problem -- it is either a bug in Drupal's GD wrapper or in GD itself.
Comment #6
vhmauery commented