When an image field has a single manual crop option, you get a nice button next to the image. This would look pretty neat in the Media file selector widget as I usually remove the 'Edit media' button to reduce clutter:

Media file selector mockup

Thoughts?

Comments

matthijs’s picture

Hi,

It would be nice indeed! But how does options like "inline cropping", "list thumbnails" fit in this?
Should they still be used in combination with the pop-up?

Matthijs

ps: sorry for the delayed response...

idebr’s picture

StatusFileSize
new1.54 MB
new1.36 MB
new39.18 KB
new38.3 KB

I would suggest moving 'Inline cropping' to the crop window, as the media list can get pretty long when uploading folders (as clients tend to do :< )

As for list thumbnails and 'Instant preview': you could move those to the crop window and merge them into 'List instant previews' ;-). This could probably improve the current image widget as well, since you get to see all your crops in the same Manual Crop window.

I made a quick mockup of my personal ideal UI:

Media 2.x widget (current):
Media 2.x widget (current)

Media 2.x widget (suggested):
Media 2.x widget (suggested)

Manual crop window (current):
crop-current.png

Manual crop window (suggested):
Crop window (suggested)

matthijs’s picture

Assigned: Unassigned » matthijs

Thanks for your nice mock-ups! I like your idea of moving the thumb list into the overlay and I'll be looking into it!

Matthijs

matthijs’s picture

I'm sorry that their isn't any progress on this (I've been quite buzzy lately), but I just wanted to let you know that this is still on my list (but it might take some time)!

Matthijs

moniuch’s picture

I fully second this idea. Was about to prepare similar mockup, but obviously I have my think-alike somewhere in the world!
The module does a great job and that's perhaps the only feature I'm missing at this point. So, yes - go Matthijs, go! :)

moniuch’s picture

I'd perhaps extend the Media widget mockup by adding the image style dropdown. This might be handy when you have a big bunch of styles defined for your site. Having to browse through the thumb list (otherwise great!) might then be cumbersome. A dropdown menu is keypress-sensitive, so with focus on, you could easily type-in the beginning of the style name and make the overlay open with your selection.
But this is just a wish list. I would gladly see just the Crop button alone for a start.

gmclelland’s picture

+1 to see the crop button

matthijs’s picture

Project: Manual Crop (old) » Manual Crop
Version: 7.x-1.x-dev » 7.x-1.4

After a long silence I'd like to ask if there's anyone willing to help with this, I started to work on this a really long time ago but I never achieved a proper result... Since I'm not a big Media fan I just don't miss this :-)

mxt’s picture

This would be very user friendly: any news on this?

Thank you very much

blacklabel_tom’s picture

Issue summary: View changes

+1 for this!

Cheers

Tom

dwatts3624’s picture

+1 here! I've been hoping that someone might have brought this up and stumbled on this thread.

Me and some others at my agency would be willing to help here.

I'd assume that some code could be referenced on epsacrop since it's UX is similar to this.

blacklabel_tom’s picture

I've had a thought about this. When you have multiple crops on the same image, which crop should the thumbnail show?

Hopefully the code from epsacrop can be shared to fix the thumbnail when there is just one crop.

Happy to test patches at my end!

Cheers

Tom

matthijs’s picture

I still find this a wonderful idea, but I just don't have the knowledge (or time to get the knowledge) of Media to get this done... If anybody is willing to make a patch, I'll commit it as fast as I can :-)

matthijs’s picture

Assigned: matthijs » Unassigned
Status: Active » Postponed
dwatts3624’s picture

I can't guarantee that we can work on this any time soon but definitely have it on our radar.

In terms of displaying the cropped thumbnail inline, I can't think of a good way to do that so the scope of our contribution would only be to display the crop button inline and use the default thumbnail file entity display.

That said, the module's default behavior seems to have an option to display all of the thumbnails at once inline. I've never used it without the media module so I don't know what that looks like but it sounds like a nice alternative. But, that said, I don't see a ton of value in doing that to justify the effort.

tessa bakker’s picture

StatusFileSize
new210.37 KB

Hi,

Did some tinkering, far from ready. But here is a screenshot of the first result with inline cropping.
The buttons are working and the cropped result is saved correctly.

Some buttons aren't default media 2.x but if the patch is ready, it will work on the latest "stable" version of Media 2.

Let me know what you think.

idebr’s picture

Looks interesting, nice to see some progress on this issue! Can you post a patch when it is ready for testing? :)

I really like the 'Crop' button is directly available in the file widget instead of in the 'Edit' form.

Inline cropping was discussed earlier in #1; the mockups I made in #2 were based on the idea to move the different crop options to the overlay. The overlay has a few advantages over inline cropping: it clears the entire screen to perform the task at hand, so the action is intuitive for users. Inline cropping does not scale very well when there are multiple crop options available and makes the form jump around when editing images.

tessa bakker’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Component: User interface » Code
Assigned: Unassigned » tessa bakker
Status: Postponed » Needs work
StatusFileSize
new5.22 KB

Here is a first patch, don't use this patch in a production setup!

Patch will apply for manualcrop version: 7.x-1.4+121-dev

Todo:
* #2394487: Allow altering the table in theme_media_widget_multiple() needs to be reviewed and commited
* Alter media 'media_widget_multiple' with new Manual Crop row
* Option to choose between 'crop in file edit form' and 'crop next to file preview'
* Thumbnail list in overlay/inline form
* A lot more testing and tweaking
* ...?

OWast’s picture

Tested Patch #18 in non-multiple context and had to make some changes to make it work.
- Removed a .js typo.
- Removed file_managed_file_validate() as a validator for media type widgets. (The validation runs anyway, but at the right time, when usage has been added.)

candelas’s picture

Status: Needs work » Needs review
candelas’s picture

Hello

Testing path in #19 with 7.x-2.0-alpha4+26-dev Media module and Manual Crop 7.x-1.4+123-dev.

The only way I see the button is if I had Manual Crop selected from the image field, not from admin/structure/file-types/manage/image/edit , so I imagine that it is there where you are testing.

With only Manual Crop selected in the image field or in both I get this warning

The file used in the Image field may not be referenced.

Thanks for your work :)

tessa bakker’s picture

StatusFileSize
new5.08 KB

Created a new patch with the changes made by OWast.

This will fix the reference error, because media has its own validation, so the core validation isn't needed.
Of it will work with an old media widget type, I don't no.

Please review, so a new version of ManualCrop can be created :D

mrharolda’s picture

Status: Needs review » Needs work

IIUC, this patch changes the behaviour to inline cropping; rendering the _manualcrop_media_element_add_after_build() useless?

I'd guess that this should be optional, or if it's mandatory, _manualcrop_media_element_add_after_build() must be removed too. I think;)

candelas’s picture

Hello

At the end I had a little time and tested patch in #22 with the settings: Show crop info, Instant preview and Default crop area. Everything worked fine.

@MrHaroldA I tried the patch with inline cropping and works perfect too.

I'd guess that this should be optional, or if it's mandatory, _manualcrop_media_element_add_after_build() must be removed too. I think;)

I don't understand :)

tessa bakker’s picture

If I'm not misstaken, _manualcrop_media_element_add_after_build() is needed if you want cropping on the file entity edit form when you press 'edit'.

An extra setting of the placement of the cropping button (file entity edit form or field instance) can be the solution.

candelas’s picture

An extra setting of the placement of the cropping button (file entity edit form or field instance) can be the solution.
@Tessa Bakker, could you implement that, please? And we put the issue to review, so we can unblock the new ManualCrop :) Thanks a lot!

candelas’s picture

@Tessa Bakker, @MrHaroldA, @OWast or any of us, in #2306801-7: Upcoming 1.5 release @Matthijs is saying:

I'm willing to release a new version without it [this patch] if there isn't a good patch by the end of next week!

The patch is almost finish, could you please solve #25? :)
It would be a way to say thanks to @Matthijs and for the community.
I will test it as soon as it is published.

tessa bakker’s picture

With some luck I will add a new patch today.

tessa bakker’s picture

Status: Needs work » Needs review
StatusFileSize
new2.87 KB

Hi,

In this new patch I made only the changes needed for Media. In this way an Image field still works and the label used by Media won't disappear.

The option to crop with the button next to the image and/or to crop on the file edit form is now depending on the ManualCrop settings on the file entity or field instance.

Please review with an Image widget, Media widget, with or without ManualCrop enabled on the Field Instance and File entity 'Image'.

candelas’s picture

Ups, I didn't realize. Tomorrow I will test it. Thanks @Tessa Bakker :)

spadxiii’s picture

Status: Needs review » Reviewed & tested by the community

It's looking good and works fine. Code-wise I can't see any problems, but I'm not completely up to date with the manualcrop-inner-workings.

The only, unrelated :), thing I ran into was better library-support. I was using an older version of jquery.imagesloaded, but the status page told me it was not installed.

candelas’s picture

It worked! Thanks @Tessa Bakker :) We are going to have a new ManualCrop version soon ;)

  • Matthijs committed f2a4aa5 on 7.x-1.x authored by Tessa Bakker
    Issue #1828178 by Tessa Bakker, OWast: Updated UI for the Media file...
  • Matthijs committed fabc48b on 7.x-1.x
    Issue #1828178: Changed a bit of code formatting.
    
matthijs’s picture

Status: Reviewed & tested by the community » Fixed

For some reason the patch wouldn't apply cleanly, but I got it committed!
Many thanks Tessa Bakker, you got my frustration-issue out of the way :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

David_Rothstein’s picture

I needed to get this working on an old version of Media (7.x-2.0-alpha3) and an old version of Manual Crop (commit 8baa1d9af from August 2013) on a site that couldn't easily upgrade.

Just in case it's useful to anyone else, here's a patch that does that.

David_Rothstein’s picture

Made a couple small fixes to the above patch.