I would love the possibility to have different crops for different image-cache-presets. In our newspaper we often would like a different crop on small images than on large. With the current state of this module, we have to use two different image-fields to obtain this feature.

The module "Imagecache javascript crop" (http://drupal.org/project/imagecrop) have the ability to crop on image-cache-preset-level.

Any chanche Imagefield Crop can have the same great feature?

It could be done by adding an option to override the crop on certain image-cache-presets.

Comments

very_random_man’s picture

I also think the ability to define multiple crops would be useful.

For example, if you want to specify a crop of the original image for node display and a separate crop for the teaser thumbnail.

Sometimes a smaller version of the same image isn't useful as a thumb and wont please the marketing or design chaps. ;-)

btopro’s picture

Yeah, I think this'll get cleaned up in D7 thanks to the file api but for 6 i think if there was almost a separate version generated as an imagecache name space (if enabled) it could do it. Im sure it's much harder then that but just +1ing this idea :)

Very cool module either way.

naero’s picture

Subscribe

grzegorz.bartman’s picture

Subscribe

gooddesignusa’s picture

Subscribe.... only reason i never used this module. Wish it had this feature from the start :(

mandclu’s picture

Subscribe, and +1 for the ability to crop to different formats based on imagecache presets.

grzegorz.bartman’s picture

Issue tags: +Imagefield, +multicrop, +openbit
StatusFileSize
new24.92 KB

I'm working on module imagefield_multicrop. It allow to make separate crops for different presets.
More info in README.txt

espenmoe’s picture

Have you created a project page?

yhager’s picture

@grzegorz.bartman, a separate module will just duplicate the effort. I think it would be better to deploy that as patch to this module.

espenmoe’s picture

@grzegorz.bartman can this be done?

grzegorz.bartman’s picture

StatusFileSize
new25.96 KB

@espenmoe not yet, but i will create project page for this module, maybe in this week

@yhager i didn't find easy way to make patch for imagefield_crop so i created new module

in attachment next version

yhager’s picture

@grzegorz.bartman if you want to share the problems, we can work together. Duplication is good only when absolutely necessary.

phl3tch’s picture

It'd be great if you could fuse this project with imagefield_crop. Subscribing.

m_z’s picture

Subscribing.

naero’s picture

@grzegorz.bartman ... I'd have to agree with CrackWilding ... why would you want to create a separate project for this feature? Instead, wouldn't it be most efficient to incorporate your code into the Imagefield Crop module?

johnpitcairn’s picture

subscribing

dimiduj’s picture

subscribing

m_z’s picture

What about using http://drupal.org/project/epsacrop for this job? (At the project page you can find a link to a nice demo page.)

Does anybody has an idea, if ImageField Crop can be used together with EPSA Crop?

timezero’s picture

I tried ImageField Crop together with ESPA Crop, but it did not work out well for me.

timezero’s picture

Does this alter Image cache in anyway? I found that I can not add any actions to most of my Image cache presets after installing this.

Edit: That was caused by another module, sorry!

Anyhow, great module. It the closet to what I am looking for. I would be looking for a module that can:

1. Crop an image according to several Image cache presets
2. Preserve the cropping box with a min-width and min-height

missing would be,

3. Be able to crop an image according to a set width but let the height be realizable by the crop box (or vice-verse)
4. Resize the crop box (preserving the ratio) to fit the image, if the image is smaller than the dimensions of the cropping box.
5. Be able to resize the image after cropping

anrikun’s picture

You may try the new module ImageField Focus
http://drupal.org/project/imagefield_focus

mxt’s picture

Subscribe

Barfly’s picture

suscribe

Brandonian’s picture

Subscribing and offering services.

I've started playing with some code to get this working on the D7 branch, and it really looks like a lot of the underlying code is probably going to need to be refactored in ordered to get this working. In order to handle the multiple instances of styles (especially during flushes and whatnot), we'll need to store that info in the database. This will also have the added benefit of putting the module more inline with how other effects are handled in D7 (i.e., not saving the file multiple times during the course of image generation). This is similar to how imagecrop handles their multiple selections, and probably the way to go.

My basic roadmap at this point looks like this. Comments/suggestions welcome.

- Add db support for saving image cropping data
- Swap out effect code to incorporate saved info
- Add interface for image effect to define default crop (if no js crop is defined)
- Potentially swap out widget? Imagecrop currently piggybacks on the managed file widget in D7, and while I personally think this works well, I'd love to discuss this further.

I'm still getting use to git, but I'm hoping to get a sandbox going here in the next day or two with some working code. I'll update once I'm further along.

Brandonian’s picture

FYI, the sandbox is up and running at http://drupal.org/sandbox/brandonian/1112418.

Brandonian’s picture

Version: 6.x-1.0-rc1 » 7.x-1.x-dev
Status: Active » Needs work
StatusFileSize
new20.69 KB

Here's an initial patch for allowing multiple crops. It's a continuation of what I started building in the sandbox (http://drupal.org/sandbox/brandonian/1112418), but I wanted to get something here for people to look at.

Although I've left code for the widget from the previous version, the real action happens with extending the image widget from core. Currently, there's no upgrade path, although I'm not sure that's within the scope of this patch.

There are still a few missing pieces here, but it's functional. The main thing that comes to mind is that I need to re-implement the inline preview for the widget.

helenrae’s picture

Subscribing...

Brandonian’s picture

Status: Needs work » Needs review
StatusFileSize
new31.35 KB

Reroll of the patch, with some bug fixes included. There are some features that could/should be added to this, but I'm going ahead and marking this as needs review in order to get more eyes on it. We're currently using this version of the module on our company web site and seems to work as advertised, and I'd really like to be able to see if we can get this functionality added the module proper.

yhager’s picture

Thanks for this. It looks interesting - I was unaware of the effect hooks. I will need to look into this more thoroughly before deciding this is the way to go. Till then, I can open a branch with this patch committed, if you like. Maybe this will ease other people in testing this functionality and possibly help out.

Brandonian’s picture

No problem. I'm all for another branch, especially since I'm sure there's plenty of polish/general work that could be done before a complete merge. Off the top of my head, there isn't an upgrade path ATM, nor did I fully implement the cropping widget (the preview is missing), plus a dozen or so other little ideas.

Feel free to contact me if you have any questions about the patch. If you're interested, I'd be willing to help co-maintain to get this functionality in.

yhager’s picture

Status: Needs review » Needs work

Ok, great!

I have created a branch named "image-effect-685676", and gave you commit permissions.
I was unable to use the patch in #29, cause it did not apply cleanly to latest 7.x-1.x.
Please reroll, or commit the patch yourself to that branch.

Thanks for your help on this!

Brandonian’s picture

Changes committed to branch image-effect-685676. I'll keep this ticket open until we merge back into the main branch, but plan on seeing other tickets opened up to finish up the work started here.

betovarg’s picture

Subscribing. Waiting to see if a D6 option comes up. Trying Imagefield Focus this moment.

karljohann’s picture

Subscribe

bryancasler’s picture

subscribe

brightbold’s picture

Sad that this hasn't progressed in the last couple of years. This is great functionality for sites working with structured content - as people earlier in the thread have suggested, to have one crop that would be used on a node page, a second for a teaser view, and a third for a grid view, for instance.