I'm using image_field cropping widget in a node. In that node I would like the cropped image to link to the un-cropped image. In the display fields page for that content type, it allows you to "link to original file", but it's actually linking to cropped version of the original file. I know that the original uncropped version still exists as I see it on the server, and when I go back to the cropping widget, the original still shows up (snapshot attached). I would just love to be able to link to it. I don't know if it makes any difference, but Im using colorbox plugin to display the enlarged image.
If you could help with a patch that would solve this, I would be happy to make a $150 donation.
Thanks much,
Dan
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | colorboxcustom.zip | 2.32 KB | amir simantov |
| Screen shot 2012-09-10 at 11.08.26 PM.png | 252.96 KB | dandolino |
Comments
Comment #0.0
dandolino commentedchanged $50 donation to to $100 donation
Comment #1
dandolino commentedNever Mind,
I'm not going to use the Image Field Crop. Been in queue too long. Just will use scale and crop image styles.
Cheers
Dan
Comment #1.0
dandolino commentedrevised explanation
Comment #2
Brolag commentedI had the same issue. It looks like the Image crop module saves a backup of the original image and creates another one (the cropped one) with the name of the original. So if I have for example "drupal.jpg" it will rename it as "drupal_0.jpg" where "drupal_0.jpg" is the original one.
In the other hand, I'm using Colorbox module and it uses the original url for the image which is changed in this case by the cropped one.
I'm using Image Crop 7.x-1.1 and Colorbox 7.x-2.4.
As a temporal solution I created a custom theme function in order to validate wich url should the colorbox use.
Comment #3
amir simantov commentedI am re-opening this issue and changing some of its attributes and would like to elaborate on it.
First, this module is a must in most of my projects, so thanks @yhager (module coder and maintainer). Second, I use the colorbox module quite a lot... So, I am tending to think that this might happen again in the future. Third, as the colorbox module is used many times to show big images in drupal projects, it may be of an interest of others to have this issue attended.
Now, it might be tempting the think that the problem is with colorbox, but I do not think so. Although the given hooking which supplied in the comment above is to tweak the display of colorbox, the problem lies in cropping module. The reason is because naturally any image-related module looks for the original name of the file; hence, the problem might occur in such other modules when used together with image crop module (this module). In my opinion, the original file - that is wisely saved and not thrown away after saving a cropped image - should be left with its original name, while the *cropped* version file will get whatever suffix needed for the colorbox module to function.
I am changing the category of the issue to 'Bug report' instead of 'Support request', as I think that it is, indeed, a bug of this module. However, if the code or logic of the module are highly relay on the underscore-zero pattern of the suffix, at may be wiser to change the category to 'Feature request', as the problematic behavior might be changed in future major versions only.
Also changed the priority from Critical to just Major; no one actually died resulting this bug :)
Thanks,
Amir
Comment #4
amir simantov commentedUploaded the module which fixes the problem.
Comment #5
RumpledElf commentedYour help function in the attached zip file calls filter_filter but if you just take that out the module works great. I needed the same functionality and that was a great fast fix for it - thanks! :)
Comment #6
RumpledElf commentedHave run into the same issue again on a different site. Very similar patch to yours, this time to print out a field in a view that is using a different image style, rather than just getting the original. The required image style is considerably larger than the cropped image and we had complaints about the quality - it was resizing upwards!
This snippet gets around the issue that subsequent image styles are applied to the cropped version of the image, not the original.
It is in a views field tpl, and also links to the node containing the image.