When rotating images using the ImageMagick toolkit, the changes aren't being saved to the original file. Processing does occur (I can see CPU usage and it takes a couple seconds). I believe the problem comes down to a misunderstanding of the way file_move() and file_copy() work. According to the docs, both functions take a source path as the first parameter and a destination directory as the second parameter. The source parameter is then updated to point to the new path. imageapi seemed to be written as if the second parameter was a destination filename. This caused the files not to be copied around correctly and the manipulated file didn't replace the source file. The temporary files were also left hanging around.
I noticed that the GD toolkit does not use the file_move and file_copy operations. It would help to know why ImageMagick needs to use temporary files when GD doesn't.
Note: This issue was originally filed as part of issue #263059: Fix rotation functions.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | imageapi_im_batch.patch | 1.17 KB | drewish |
| #3 | imageapi_im_264006.patch | 1.21 KB | drewish |
Comments
Comment #1
drewish commentedgd uses doesn't use temp files because it does it in memory... was there a patch for this?
Comment #2
drewish commentedoh, i guess i posted this to the wrong issue...
Comment #3
drewish commentedokay here's the relevant part of the patch from the other issue.
Comment #4
junyor commentedThis is an issue in the 5.x release and I'd like to see it fixed there. About this patch, dopry said:
So, I need to do some more testing to make sure duplicate files aren't used/overwritten when multiple manipulations are done.
Comment #5
junyor commentedAhh, looked at your patch again and I see that you aren't doing the temp file stuff here anymore. Cool. I'll test your patch when I get a chance.
Comment #6
drewish commentedcool, love to hear your feedback.
typically commits are done to HEAD and then backported to ensure that when you upgrade you don't run into old bugs.
Comment #7
junyor commentedGotcha.
Comment #8
dopry commentedwhee, committed to DRUPAL-5 and HEAD.
Comment #9
dopry commentedoh yeah fixed.
Comment #10
drewish commentedactually it didn't get committed to DRUPAL-5, here's a re-roll.
Comment #11
drewish commentedwent ahead and committed this to DRUPAL-5 since you thought you already had.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.