I'm having an issue where I can upload and apply a crop area to an image when a node is created, but when the node is edited next the crop area is not applied. This means every time you edit a node the crop has to be reapplied.
I'm running Drupal 6.17 and the latest version of all other modules...
The settings I am using are:
The resolution to crop the image onto: 94x94
Enforce crop box ratio: Yes
Enforce minimum crop size based on the output size: Yes
The resolution of the cropping area: 500x500
Is anyone else encountering this issue?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | image data database field dump | 502 bytes | sydneyshan |
| #4 | Imagefield Crop HTML before jQuery | 2.75 KB | sydneyshan |
| #3 | Imagefield Crop HTML | 6.5 KB | sydneyshan |
| #3 | Imagefield Crop reset snapshot | 168.76 KB | sydneyshan |
Comments
Comment #1
sydneyshan commentedComment #2
troyer commentedSame problem here, crop area isn't retained when I edit a node where a crop area has been defined. This error has creeped in in the RC2. I didn't have this problem before.
Comment #3
sydneyshan commentedI've attached both the generated HTML and a snapshot of the issue in the hopes this may help troubleshooting...
Comment #4
sydneyshan commentedAttached is the serialized data from the content type's image data and the HTML before it has been affected by the Imagefield Crop jQuery. I can't see any reference to the height/width/offset of the previously specified crop, therefore it wouldn't be applied to the cropping area when editing the node/imagefield.
Comment #5
sydneyshan commentedIf I don't touch the crop interface when editing the node the existing thumbnail is retained.
It would be better if the image crop interface would match the previously selected cropping area so as to avoid confusion - I'm sure it has worked like this in the past...?
Comment #6
troyer commented@sydneyshan are you using the jquery update module or something related?
I'm asking because I rolled back to RC1 and the problem persists, so it must be some other module interfering.
Comment #7
sydneyshan commented@drupidoo I've disabled both the jQuery Update and the jQuery UI modules but the problem still persists. I have a working version of Imagecache Crop on our intranet so will investigate the differences between the two environments today. My colleague has been making some jQuery/jQuery UI updates so I'll check in with him to ensure the core hasn't been hacked or anything...gasp! Will check back in shortly.
Comment #8
sydneyshan commentedOkay, I've figured out this is a conflict with the Filefield module's Filefield Meta sub-module. Disabling Filefield Meta from the modules list works a treat.
Further investigation in to why Filefield Meta seems to be overwriting or messing up the cropping data supplied by Imagefield Crop needs to occur.
Comment #9
troyer commented@sydneyshan I can confirm this. Only disabled the Filefield Metadata module and now Imagefield Crop is back to normal. Not perfect but since I'm not using the Filefield Metadata module it's a workaround for now.
Comment #10
greenskunkA site I work on does NOT have the Filefield Metadata module enabled and yet when editing ignores my selection and the preview area does not show a new preview when you crop. Does not remember your cropped selection either when editing a node again.
Lets see what happens when I disable some modules.
Comment #11
m_z commented@GreenSkunk: Same for me. I also have the problems with Image Crop when editing a node, but I don't have activated the FileField Meta module.
It seems to be another module which can cause this problems. Maybe it is the same reason so any deeper insight would be welcome!
Here some modules which are activated on my Drupal 6.19 installation:
- Content 6.x-2.8
- FileField 6.x-3.7
- Image crop 6.x-1.0-rc2
- ImageField 6.x-3.7
- FileField Paths 6.x-1.4
- jQuery Update 6.x-1.1
- jQuery UI 6.x-1.3
Any ideas?
Comment #12
m_z commentedAfter writing #11 I did some experiments with a fresh installation and the modules mentioned above.
Good news first: jQuery Update and jQuery UI don't seem to affect ImageField Crop module.
I found that FileField Paths module causes the strange behaviour that inside your "Crop area" the cropped and NOT the original image will be shown.
If you don't want to change your image while editing a node, you will have one of the following cases:
1.) If your cropped image has the minimum size, than it remains unchanged after you finished editing a node by clicking the save button at the bottom. (The dashed line is at the border of your Crop area.) --> This case is the better one.
2.) But if the cropped image is bigger than the minimum size, than there is a very strange behaviour: The cropped image will be cropped again with the selection in your Crop area that you selected while creating the node. (The dashed line is inside your Crop area.) --> This case is very bad.
The problem occurs right after enabling FileField Paths module. I didn't even set a path for my imagefield... Very strange...
Comment #13
greenskunkGreat job M_Z! On most of Drupal installations, I setup the FileField Paths module. It must have been something with one of the latest releases.
I've got a dev area that I'll try to trace this down on.
Comment #14
m_z commentedHi,
I got some new insights: The problems seems to occur only, if you are trying to upload an image file with the same filename more than once (like most of us will do while testing such a module... :)
Easy workaround: use filefieldpath to rename the uploaded image file by adding the upload timestamp or the node updated timestamp or something else which makes the filename unique.
There is something wrong with the file renaming in imagefield_crop / filefield_path when a file name occurs multiple times...
Comment #15
pcambraAdding [raw] to filepath settings of the field solves the problem, thanks M_Z!
Comment #16
jlongbottom commentedThis has been happening to me with the latest non-dev version 7.
Renaming and re-uploading the file seemed to fix it. I have not been able to reproduce it since. Weird.
Comment #17
jlongbottom commentedThis has been happening to me with the latest non-dev version 7.
Renaming and re-uploading the file seemed to fix it. I have not been able to reproduce it since. Weird.
Comment #18
joetsuihk commented@eSentrik please try 7.x dev version.
Also, from the discussion, it seems the problem exists in filefield_path rather than imagefield_crop
rc2 is years ago, I am marking this fixed, assume 1.0 version already fixed this. Please re-open this to 6.x version only.
For 7.x, please open a new issue.