Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Could it be possible that the original image is also saved?
For example, my users crop an image to be displayed on the front page (I need cropped image because of the specific layout), but I would like that uncropped (regular) version of that image could be displayed on the node page without the need for users to upload the image once again.
Comment | File | Size | Author |
---|---|---|---|
#26 | formatter.patch | 1.6 KB | chrisirhc |
#26 | formatterfile.patch | 1.26 KB | chrisirhc |
Comments
Comment #1
nevets CreditAttribution: nevets commentedYou might be better off using the image field and image cache. That way the original image is saved and you can provide an image cache preset that provides a cropped image.
Comment #2
point-1 CreditAttribution: point-1 commentedI can't do custom crop using imagecache. I am using imagefield + imagecache for other purposes, but in this case users must be able to choose the part of the image to crop.
Comment #3
yhager CreditAttribution: yhager commentedThe only solution for this for the moment is to use two fields - one for the original image, another for the cropped one.
I'll keep this note for future revisions of this module.
Comment #4
Florian R CreditAttribution: Florian R commentedThis would be realy cool feature. This way it wiuld also be possible to change the croped image.
Comment #5
mrfelton CreditAttribution: mrfelton commentedyou can do this with the imagecrop module.
Comment #6
yhager CreditAttribution: yhager commentedWhile working on the 6.x version, it seems that this can be done (currently I am able to save the original for recropping). I might add an option to display it as well.
Comment #7
yhager CreditAttribution: yhager commentedThe original is saved in the 6.x version. This issue is left for tracking the other part - displaying it.
Comment #8
bflora CreditAttribution: bflora commentedHow about for D5?
Comment #9
yhager CreditAttribution: yhager commented@bflora: sorry, no plans to backport this into D5.
Comment #10
bflora CreditAttribution: bflora commentedOuch. That stinks. *bangs head against wall*
I'm sure the people behind it had great reasons, but why'd they make six so different from five that people like you aren't able to carve out enough time to backport your modules?
Ugh.
Comment #11
yhager CreditAttribution: yhager commented@bflora: imagefield undergone a major change between 5.x and 6.x. It was actually re-written twice(!). The result is very well done, and the code is very well crafted, so I was able to achieve this quite easily.
With D5, the situation was more complex, and it was difficult enough for me to achieve cleanly, so I gave up on this. With Drupal 5.x being in maintenance mode, I have put imagefield in maintenance mode too.
If you (or anyone) have the ability to help this in some way (donate code/money) - I would happily accept.
Comment #12
bflora CreditAttribution: bflora commentedI understand where you're coming from. I didn't mean to come off badly.
I was more frustrated with why d5's core is so different form d6 that backporting modules and features is such a hassle.
I've got Zero dollars these days so no can do on the funding front. Perhaps someone else can step in and make it happen though.
Comment #13
tjodolv CreditAttribution: tjodolv commentedSubscribing
Being able to choose between the cropped or the original – and any imagecache preset for both of these – will make this module *the* "killer-app" in my book :)
Comment #14
ScarabMonkey CreditAttribution: ScarabMonkey commentedseconded! I want to use the cropped image and when clicked I get a lightbox with the uncropped...
Comment #15
yhager CreditAttribution: yhager commentedThis shouldn't be very hard to accomplish, since we already save the original image, we just need to add a formatter that displays it.
My only problem on this is severe lack of time to handle this. If anybody can help with a patch, it would be a great help. Thank you all!
Comment #16
ShermanB CreditAttribution: ShermanB commentedI just wanted to throw my two (virtual) cents in here and say that this would be an exceptional feature: Being able to custom crop to an imagecache, and drop the original in another one. Wow!!!
I'll be digging through the source to find a hack but look forward to seeing this in the future! Thanks for the great module!
Comment #17
bflora CreditAttribution: bflora commentedWould still like to see this for D5. What would it cost to pay someone to get this working for D5?
Comment #18
matkeane CreditAttribution: matkeane commentedHi,
I agree, it would be good to see a formatter solution, so that the full-sized image could be displayed through the UI. In the meantime, I've found a theme-based solution for a D6 site (might also work in D5 - not sure).
The original, uncropped, image is stored alongside the cropped version with the '.crop_display.jpg' suffix. Imagefield Crop loads a bunch of data about the cropped image into the node object, so on the full-page display, I've added a bit of code to my template for this particular node-type which uses imagecache to display a scaled version of the uncropped original.
I've just thrown this together quickly, so I need to add in some checks to make sure things are actually returning what they should be before I display the image, but it means I can show a cropped banner image in the teaser, which will link to a page with the original image and the title/description, which was what I needed.
Comment #19
bflora CreditAttribution: bflora commentedCan you give me an example of what these URLs would look like? I played around with it a bit but don't think it works that way for D5 as I just got 404 for every different permutation I tried.
Comment #20
matkeane CreditAttribution: matkeane commentedI didn't mean to drag this issue too far away from the original request about the D6 UI...
but in my content-type, the imagefield_crop field path options are set to save images in 'images/banners', and when I look there I see:
/files/images/banners/IMG_2147.jpg (cropped image)
/files/images/banners/IMG_2147.jpg.crop_display.jpg (original uncropped image used for the crop interface)
Like I say, this is in D6, and things may be very different in the D5 version. Hope it helps anyway...
[Edit] Question to the module maintainer: My theme-based hack assumes that uncropped images will always be stored in the same way - is that a fairly safe assumption to make?
Comment #21
yhager CreditAttribution: yhager commented> Question to the module maintainer: My theme-based hack assumes that uncropped images will always be stored in the same way - is that a fairly safe assumption to make?
Sorry, I didn't notice the question, since you edited your reply.
I guess you can assume this will not change for the near future. Although the naming might not be idea (crop_display?? what was I thinking?), it is too dispressed now to change..
Comment #22
matkeane CreditAttribution: matkeane commentedHi,
Thanks for confirming that. Would it be difficult, or a pain, to add an element to the node object with the filepath to the original image - e.g. $node->field_banner_crop[0]['filepath_original'] ? That way, it wouldn't matter if you did change the naming convention in the future, as each image would store the path to the original - although I guess that might mean another field stored in the database somewhere. Anyway, as things are, it works - thanks!
Comment #23
yhager CreditAttribution: yhager commentedI prefer to add a display option that would be accessible through the UI, rather contaminating the node structure with a variable that very few developers will use.
Comment #24
matkeane CreditAttribution: matkeane commentedI agree that a UI option for that would be useful to more people, as this thread shows.
The word 'contaminate' seems a little harsh though! Extra little bits of information like that can be very useful to themers, and it's frustrating to have to make extra function calls - or worse still, database queries - to get data that could have been supplied by the module. But that's a general grumble - I'm not pointing a finger at your module when I say that!
Comment #25
daemon CreditAttribution: daemon commentedThis is the feature I am looking for!
Upload
1. Upload a large image
2. Select which part to scale/crop
Display
1. Node Preview displays scaled/cropped image
2. Full Node displays scaled/cropped image
3. Clicking on the image links to the original full sized one (or preferably, lightboxed original full sized image)
Comment #26
chrisirhc CreditAttribution: chrisirhc commentedI've added formatter for the field under the imagefield_crop module.
I don't know if there's a way to restrict it to fields using this particular widget, I left it for filefield and added a description indicating that it would only work for image fields that were used with the imagefield_crop widget.
Comment #27
yhager CreditAttribution: yhager commented@chrisirhc: thank you for this!
I too haven't found a way to restrict the formatter according to the widget. For this reason, we need to handle the case that these formatters are used (mistakenly) by regular images(files?).
Comment #28
chrisirhc CreditAttribution: chrisirhc commentedNo problem :)
Maybe add a check for the existence of the uncropped file? Link to or show the original if not found. Though I think it's probably bad practise for the theme function to do so much.. Not too sure.
Comment #29
cels CreditAttribution: cels commentedsubscribe
I check the patchs on my drupal
Comment #30
drupalina CreditAttribution: drupalina commentedFor example, I want to create a gallery with multiple Imagefields. I want the gallery to display thumbnails 100x100, which are created by Imagefield_Crop. But when people click on that thumb I want a 650x650 version of that picture to open up in Lightbox. (Problem: right now when they click the thumb it opens up a large version of the thumbnail, which looks all pixated and ugly)
And the best way to achieve this would be to integrate with Imagecache, so that the manual ImagefieldCrop could be added as an ImageCache action in one of the presets. In that way you actually end up killing 3 birds with one stone:
1) You can generate a manual thumbnail with ImagefieldCrop, and if there was no manual thumbnail then the system can fall back onto an automatic Scale-n-Crop by ImageCache module.
2) Importantly, users can go and edit the display of their Imagefields and tell drupal to display "Lightbox: ImagefiledCrop100x100 -> 650x650"
3) Users can have best of both worlds: thumbnails with manual Imagefield_Crop and larger versions with Imagecache.
I think http://drupal.org/project/imagecrop already integrated with ImageCache (even though this module is way more user-friendly for end-users). So maybe the efforts may could be combined, or maybe some of their Imagecache integration code can be taken.
I think making ImagefieldCrop work with Lightbox would be an essential addition here, because many people would want to turn to ImagefiledCrop module in case they are not happy with automatic thumbnails generated by Imagecache.
PS: I'm wondering if any of these patches are doing this (sorry, I don't know how to apply patches) and whether anything like this will be committed to .dev anytime soon. Once it's in .dev, I'll be the first one to test it.
Comment #31
jacktonkin CreditAttribution: jacktonkin commented@drupalina: there is a patch in #426892: Add uncropped image to Display Fields list (imagecache) that does at least what you describe in #30.3.
Comment #32
bleen CreditAttribution: bleen commentedsuperscribe
Comment #33
q0rban CreditAttribution: q0rban commentedI'm pretty sure this is a duplicate of #426892: Add uncropped image to Display Fields list (imagecache)...
Comment #34
q0rban CreditAttribution: q0rban commentedWell, maybe not as this issue isn't about imagecache is it? The two separate issues should probably be combined into one patch though, IMO.
Comment #35
robby.smith CreditAttribution: robby.smith commentedsubscribing
Comment #36
shiva7663 CreditAttribution: shiva7663 commentedsubscribing
Comment #37
sholn CreditAttribution: sholn commentedIt would be great having it also in views field !
Comment #38
marvix CreditAttribution: marvix commentedsubscribing
Comment #39
timezero CreditAttribution: timezero commentedhttp://drupal.org/node/862170#comment-3246128
Comment #40
aidanlis CreditAttribution: aidanlis commented#26 works for me ... it would be nice if the module author gave these issues some direction. This issue was opened 3 years ago.
Comment #41
brunorios1 CreditAttribution: brunorios1 commentedsubscribing
Comment #42
crashtest_ CreditAttribution: crashtest_ commentedSubscribe
Comment #43
vikramy CreditAttribution: vikramy commentedSubscribing
Comment #44
HansKuiters CreditAttribution: HansKuiters commented#26 works for my use case. Thanks.
Comment #45
dahousecat CreditAttribution: dahousecat commentedThis worked for me:
Where field_image_n_thumb is the name of my cropped image field.
Not sure if this is the best solution but will certainly do for now...
Comment #46
ShaneOnABike CreditAttribution: ShaneOnABike commentedI don't see any reason why we can't push #26 patch ... I think it could be expanded to add more functionality but for now it's fine!
Comment #48
ram4nd CreditAttribution: ram4nd as a volunteer commented