| Project: | Imagefield Crop |
| Version: | 6.x-1.0-rc2 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If you create a node with an imagefield and use foo.jpg as your image, after saving the node you will have foo.jpg and foo.jpg.crop_display.jpg images in the filesystem. If at a later point another image called foo.jpg is uploaded, the user has no indication that it is a duplicate, and the preview and crop appear to work fine.
When the node is saved, the files need to have another name, as overwriting existing images is not ideal. Drupal will append an _0 to the end of the filename, the part preceding the final extension. This works for the cropped image, foo_0.jpg but for the original it now becomes foo.jpg.crop_display_0.jpg.
In the imagefield_crop_file_admin_original_path function, it looks for a file called filename.ext.crop_display.jpg this will always fail as the _0 is in the wrong portion of the name, which then returns the cropped image as the original, causing a recursive cropping each time the image is edited.
Comments
#1
Confirmed this is happening and explains a lot of inquires I received from users.
Changing priority to major as this breaks functionality
Subscribing
#2
So the correct name it should be changed to is foo_0.jpg.crop_display.jpg vs foo.jpg.crop_display_0.jpg?
I have no programming skills but will help test asap if someone can help with a patch.
Thank you
#3
I'm having this problem still.
When a user uploads a image filename that is the same as a previous user's image upload, the previous user's image shows up!
Very scary if you think about it as a profile node and you're trying to upload a picture of yourself and see someone else =O
#4
I was trying to reproduce it, but i couldn't.
user 1 added story with foo.jpg
user 2 added story with foo.jpg (the same)
user 2 added story with foo.jpg (another image)
please correct me if i'm doing something wrong.
and everything shows fine for me. and i have names as foo_1.jpg.crop_display.jpg
i have drupal 6.2 and using cck field with cropping.
CCK Content 6.x-2.8
CCK FileField 6.x-3.7
Image crop 6.x-1.0-rc2
#5
Hi Naiya,
When I do the exact same steps you describe, the image uploaded b user 1 is shown when user 2 uploads a picture =(
#6
Strange, what version of modules are You using? Did You try to reproduce it with fresh drupal installation with cck and imagefield crop modules only?
#7
I have the same problem
#8
This has been driving me crazy. Glad someone figured out what is causing it.
#9
Did You fix this problem?
#10
I'm also in need of an answer here. What version is working?
#11
I took a day to try to troubleshoot this issue (using 6.x-1.x-dev [2011-Apr-25]). I don't have the time to look into the issue myself at this point, but just want to "subscribe".
#12
I hope to have solved this problem of relationship between the pictures by this modified method that generates the new name of the original image (imagefield_crop_file_admin_crop_display_path).
#13
I solved it by making sure the filenames are unique. In the FileField Path settings I added [mod-raw] to the file name. It now becomes [filefield-onlyname-original]-[mod-raw].[filefield-extension-original]. I use 6.x-1.0 and didn't apply the patch from #12.