I vote for a new effect which is as simple as selecting previously applied crop effect, if any.
For example, imagine we have 3 different crop styles which we use for uploaded images, depending on the image composition. Obviously when we print images we want to use applied crop effect but currently it's not possible to know which effect was applied.
I'm preparing a patch with new effect atm.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | manualcrop-1936424-12.patch | 7.82 KB | OnkelTem |
| #11 | manualcrop-1936424-11.patch | 7.82 KB | OnkelTem |
| #9 | manualcrop-1936424-9.patch | 6.29 KB | OnkelTem |
| #5 | manualcrop-1936424-5.patch | 4.54 KB | OnkelTem |
| #1 | manualcrop-1936424-1.patch | 4.54 KB | OnkelTem |
Comments
Comment #1
OnkelTem commentedThe patch provides new effect called "Select applied Manual Crop selection".
Configuration form example:

Comment #2
OnkelTem commentedFor dimensions transformations to work (i.e.
widthandheightattributes on<img>) see this followup: #1937342: Provide dimensions callback for Select effectComment #3
matthijsHi,
Thanks for your patch, but unfortunately I don't fully understand the point of this effect... Could you explain it a bit more?
Matthijs
Comment #4
OnkelTem commentedI'll try :)
It is similar to Reuse effect, but differs from it the next things: while with Reuse you specify which crop style to take, this new effect picks a style automatically — it just selects applied style via consulting manualcrop table, and if no crop was applied for the image, it falls back to one specified.
Use case:
Imagine you have vertical and horizontal photos, and you want to crop them appropriately, so you define two styles:
and use either of them when uploading photos.
Now you want to list photos in a gallery e.g. with Views but how would you configure image formatter to print a photo using applied crop effect? This effect is the answer. You just create a style using "Select" effect and whenever a photo is requested via it, it will return an image with either 200x150 or 100x150.
Does it make things clearer?
Comment #5
OnkelTem commentedFixing minor typo + reroll on the lastest "7.x-1.x"
Comment #6
matthijsAllright, I get it now, thanks! I'll review and commit your patch soon.
Thanks again!
Matthijs
Comment #7
OnkelTem commentedOk, good.
There is a place in my patch which I dislike:
I was not sure what element I can use instead of "markup" to not add "label" manually.
Comment #8
matthijsMaybe you can use the form type "item"?
Comment #9
OnkelTem commentedThis is updated version of the patch.
manualcrop_select_summaryto the theme array to fix lacking summary._manualcrop_is_own_effect(). Also I took the liberty to refactor this helper function to make it easier to read. It was:and now reads as:
Comment #10
OnkelTem commentedI started getting a warning: Notice: Undefined index: reusestyle в функции manualcrop_preprocess_image() (строка 791 в файле /var/www/lib/d7_dev/extensions/modules/manual-crop/manualcrop.module).
Nevermind, I'll fix it. The reason -
manualcrop_preprocess_image()expects only 'reusestyle' as style_name.Comment #11
OnkelTem commentedNew version of the select effect patch.
* Now fallback styles option list include only other styles, not manual-crop based
* Added handling of the effect transformations to manualcrop_preprocess_image()
Comment #12
OnkelTem commentedFixed a whitespace :P
Comment #13
matthijsPatch applied an committed! Thanks!