Problem/Motivation

The crop list is confusing in UX because it is not following common patterns in Drupal.

- Titles "Crop List" is way too large title (unusual).
- The black outlined box does not represent the aspect ratio. Instead it just outlines the aspect text.
- The items in the list don't look like an active clickable item.
- Strange behavior if you just click into the image
- Strange behavior if you delete a crop: the image just disappears

With the example
- 4:3 and 16:9 are output twice in the title (if the aspect ratio is already added to the crop title..). This is redundant information. What would be a real best practice?

Proposed resolution

User interface changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker created an issue. See original summary.

miro_dietiker’s picture

When switching the image field into a multi value field, there is an operations column.
We think that "Crop" is a button that should appear in the operation column.

Lukas von Blarer’s picture

Assigned: Unassigned » Lukas von Blarer
Lukas von Blarer’s picture

Attaching a patch with the first draft of the new widget. Work in progress...

sasanikolic’s picture

Current status in the attached screenshots.

TO-DO: Actual cropping of the image and display of the cropped image in the table.

woprrr’s picture

Initially the idea was to offer an ui a little more "sexy" than what we had in the old crop module.
Currently this is a good interface to better integrate drupal it's true, but for user expérience, I think this UX loses much the side "sexy" of the widget.

What may be possible it would be to find an interface for the plugin to be able to keep the basic interface system (Drupal Way) and a more graphical and intuitive interface (and therefore able to offer a really cool features that will add custom interfaces to the crop module). The idea that would provide a system of LIKE as media_entity providers, who will be in charge of rendering elements and necessarily generate within PROCESS.

What are your views on the subject?

sasanikolic’s picture

Together with @miro_dietiker, @slashrsm and @Lukas we discussed about it. We thought about implementing a completely new UI, but that would take too much time and complexity to figure out how to restructure everything. Since the current solution is very similar to the vertical tabs (used in core), we can use that as a starting point and implement the same features as we have currently. So we will have all the tabs with ratios and in the content a checkbox to enable and disable it, together with the image to crop (or with the current cropping applied). This would also solve the broken responsive design that we have now and with it, we could get rid of all the custom CSS and javascript.

We will start working on it shortly and post some mockup screenshots.

woprrr’s picture

Thank you for that overview , I actually partler with slashrsm so we'll see for a redesign more "standard" . My idea for doing this would be to do like what I propose with IEF .

woprrr> Therefore so we can adapt ImageWidgetCrop a fully integrated drupal, and kind of "Fork" with the current interface? this sounds good solutions.
slashrsm, Otherwise we can offer two widgets, a standard and complex.
yes

Thus we can keep the original class and move the formatting function "process" current widget in a "complex" and see for a "standard" version of what we 'd FieldWidget " Complex " & "Standard". We could also take a class like " Manager " to keep all common areas in both widgets in one place and spread it in the various widgets.

What do you think ?

woprrr’s picture

Lukas von Blarer’s picture

Status: Active » Needs work
FileSize
7.78 KB

@sasanikolic and I replaced the ratio list with vertical tabs. The cropping itself is broken because now we will have a cropping area per ratio.

@woprrr: what do you think?

Lukas von Blarer’s picture

woprrr’s picture

To simplify the synchronization and advancement, I was creating a specific branch redesign and standardization of the UI,

https://github.com/woprrr/image_widget_crop/tree/standardize-ui

woprrr’s picture

@Lukas von Blarer

I have not had time to move forward on the JS part, but I have noticed that you remove the items ('thumb-w', 'thumb-h') it is important not !! it's elements are essential to the calculation of dimenssions out of the way to real thumbnail size picture. @see getThumbnailCropProperties(). We must add this, we can ping me in IRC.

Lukas von Blarer’s picture

I created a final pull request for this: https://github.com/woprrr/image_widget_crop/pull/14

There are several follow-up issues which I will file in the next days.

woprrr’s picture

    //@TODO: $properties['thumb-h'] should be calculated here. It also prevents crops being saved the first time since this is not set.
    $delta = $original_height / $properties['thumb-h'];

I just have a comment about this TODO. For the record we have no means in the code to find the final size of the thumbnail before its creation, because we will not know the dimenssions This is due to the scale of the width. That's why I used jQuery to give me the size of the thumbnail and fournisait has the calculation function. I think we naurons no other way to guess the height to retrieve the delta load image.

Lukas von Blarer’s picture

Status: Needs work » Needs review
FileSize
75.33 KB

Attaching the patch of all the changes we did last week at the sprint. Lets get this committed and move forward with follow-ups.

miro_dietiker’s picture

woprrr, the sprint from last week is over and i fear that if we don't get this in quickly people will not have enough focus and time to complete it.
Please define what is absolutely critical for a commit in your opinion and we will try to push the remaining things.
Otherwise, please commit it as is and create followups.

IMHO the current approach is nicely aligned with Drupal UI components and looks very usable.

Do you agree with the direction (or is your previous UI still candidate to coexist)? I would appreciate if we can focus all activity to reach a stable V1 with as few resources as possible together.

woprrr’s picture

@miro_dietiker

Tonight I will finish the review of the "standardized" version and the merge with the different tickets. In terms of the solution that we have seen done for coehexister both interfaces, I'll go on a simple way. Merge the standard version and once I finalize the version with a more complex interface with cropper I merge into a second widget after.

miro_dietiker’s picture

That sounds great, thank you!
I'm pretty sure the solution will evolve a lot over the coming weeks, at last in small ticket steps. We discussed so many small improvements / ideas.

Once merged i will check the whole calculation of crop pixels and crop view port scaling. From the discussions and some code i think we should improve it a bit to get rid off some complexity.

woprrr’s picture

Status: Needs review » Needs work
FileSize
76.19 KB
405.44 KB

There is a problem now, the corp has the record is not taken into account. If I edit the content and I made a new area when the crop is considered. I think having remove $ verification entity-> new () is not a very good idea.

A publishing corp zone for the first element, it is very small. @see screenshots.

Lukas von Blarer’s picture

Issue summary: View changes
FileSize
55.52 KB
375.21 KB
343.35 KB

@woprrr What browser are you using?

Here are the requested screenshots of the working UI.

Widget after uploading the image:

Widget after opening the cropping accordion:

Widget after cropping:

woprrr’s picture

Status: Needs work » Needs review
FileSize
18.44 KB
81.83 KB

I v fixed all "criticals" bugs for provide an version fonctional with standardization ui.

Lukas von Blarer’s picture

Status: Needs review » Reviewed & tested by the community

Setting to RTBC. Lets create follow-ups for the remaining issues.

woprrr’s picture

Status: Reviewed & tested by the community » Fixed

Great job all ! Thanks !

Status: Fixed » Closed (fixed)

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