I have found that it is not possible to crop an image that has already been uploaded and saved. For example, you upload an image, crop it slightly, save the node. All works perfectly. You then edit the node again to crop again, you can set the crop area fine but it does not actually crop the image.
I would also like to thank the author of this module! I have been searching for this exact solution, and was about to begin writing my own module for it, but have very little experience with image manipulation and the image libraries! I am very willing to help with these issues, and so will be looking how to solve the above.
Comments
Comment #1
yhager commentedI'm glad you find this module useful.
Please note that after you crop an existing image, the image you see in your browser is a cached version of the image. Try to press 'Refresh' on your browser and see if that refreshes to the cropped image. I am not sure how this can be solved otherwise(changing the file name seems to me like an unacceptable solution).
Having said that, there was a bug that cause an existing image to disappear if you cropped it and clicked 'preview' before 'submit'. I have just committed a fix for it - grab it from CVS or wait till tomorrow (Jan 22) for packaging scripts to create a new version.
Thanks for reporting!
Comment #2
bones commentedOn further inspection, I have found this is actually an imagecache issue. All that needs to happen is to flush the imagecache on line 190:
Interesting you mention the browser cache problem as I was just looking at that myself. Why do you think that renaming the file is unacceptable? It seems to be the cleanest solution to me, especially as the file is actually changing (it has been cropped and therefor a different image).
Thanks for your response!
Comment #3
yhager commentedI committed the fix for imagecache. Please test to see if it works for you, cause I am not familiar enough with that module.
Why do you think that renaming the file is unacceptable? It seems to be the cleanest solution to me, especially as the file is actually changing (it has been cropped and therefor a different image).
It *would* be the cleanest solution had this was an independent module. However, this is just a widget on top of imagecache field, and as far as imagefield is concerned, this is the same file, so no necessary updates are not being made on the node.
Comment #4
bones commentedThanks for that, will check and make sure it works.
Have started a new issue for the browser cache problem at http://drupal.org/node/212622
Comment #5
yhager commentedComment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
Lapino commentedApparently this doesn't work in the 6.x version of this module. Is it possible to implement this in the new version?
It's the only thing that this module needs to make it perfect for me.
Comment #8
yhager commented@Lapino: Can you test the attached patch?
Comment #9
Lapino commentedI've tested it on a couple of pictures on my site and two different imagecache presets and the above patch seems to work.
The fast reply was impressive by the way, thanks!
Comment #10
yhager commentedThanks for the testing. Committed.
Comment #12
mckeen_greg commentedI can confirm this works. However, a Hard Refresh is needed on my side (perhaps that was what was needed along?!)... now, is that Firefox or can something also be done about that? How many users will Force a Refresh to see changes to images, and how many will do so often? None Im assuming.
Edit: Ok... upon thinking about this further, I can confirm that this doesnt work. Patch installed correctly. beta version. Forcing a Refresh is not default behaviour when using ImageCache is it? I know that if I go to: ImageCache > Presets > [namespace] > Flush Cache, I wont have to force a refresh to see changes to my images... it just works. Can anyone else confirm this?
Comment #13
yhager commentedPlease try and install the latest dev version of imagefield - it contains a fix to this hard refresh issue.
Comment #14
mckeen_greg commentedYAY! Fantastic! Installing the latest Dev version of ImageField fixed this.
May I suggest you commit the fix above? Your module is awesome, and I recall choosing not to use it last year for this very reason on a D5 install. Now that the behaviour has been ironed out, I am sure many people will be moved by it. :)
Thank you for your hard work!
Comment #15
yhager commented@mckeen_greg: Thank you for the spirit :)
The core of the refresh issue is with imagefield, and I was able to send them a patch. They committed it and it is still in dev - and will be in their next release. There's nothing to do but wait for a new imagefield release.
Comment #16
xpersonas commentedHey guys, I'm having this issue. I'm running:
ImageField 6.x-3.2
ImageCache 6.x-2.0-beta10
Imagefield Crop 6.x-1.0-rc1
I don't even see a dev for imagefield so i'm assuming i'm up to date? Anyone know why this is not working for me, possibly?
Comment #17
yhager commented@phaedo5: I am not sure why this is not working for you, it should.
Could it be a permission issue? Do you have any special config or setup, or anything which can shed more light on this?
Comment #18
xpersonas commentedI wish I had more to share on my setup. It's pretty basic Drupal 6 site. I'm not doing anything funky. I don't have an issue, but it seems to be an issue to some of my users. They may be on Windows machines. I'm trying to get that information. I'm on a mac running FF.
Comment #19
yhager commentedmaybe it is an issue with browser refresh that you are experiencing and not with imagecache flush.
What happens when you refresh the page? Does that fix the problem?
Comment #20
xpersonas commentedIt may well be an issue with the browser refresh. Getting information from my users is like pulling teeth sometimes. But it sounds like it shows up when they clear their browser cache. So perhaps I mistakenly thought I was having the issue described in this thread. Sorry to waste your time on it. This module is awesome. It works great for me :)