Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Original ratio" Media image view mode #49

Open
Adnan-cds opened this issue Dec 15, 2020 · 6 comments
Open

"Original ratio" Media image view mode #49

Adnan-cds opened this issue Dec 15, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@Adnan-cds
Copy link
Contributor

There are times when the default 3:2 Responsive image style just isn't enough. The Original ratio Media view mode should help in those times. This will allow editors to apply that odd crop which none of the existing crops could cover. A good example is a map image that doesn't fit any of the given ratios:
Map image
Image source is a LocalGov Subsite page.

Implementation

Here are what we need to fully implement this:

  • 1x Original ratio crop. This should be a Free-form crop.
  • 2x Original ratio Image styles. These image styles should have fixed widths.
  • 1x Original ratio Responsive image style that uses the above 2 Image styles.
  • 1x Original ratio Media image view mode that uses the above Responsive image style.
  • The WYSIWYG also needs to offer this Original ratio Media image view mode alongside the existing ones.
  • Eventually we will also need a separate Image Paragraph that uses this Original image view mode to display its image. But that's for another ticket.

FAO @finnlewis @lbcwebmaster @willguv

@Adnan-cds Adnan-cds added the enhancement New feature or request label Dec 15, 2020
@finnlewis
Copy link
Member

Interesting.
Makes sense, mostly.
Once question though, if you're intending to display the image at its original ratio, why have a crop at all?

@Adnan-cds
Copy link
Contributor Author

why have a crop at all?

We have seen people here uploading 2+MB images. These ruin the UX when you later try to view such pages in a real mobile phone. To avoid this, a crop can impose a maximum width while retaining the original ratio thereby ensuring a reasonable image size. That's the rational in my mind.

It is possible to optimize the image size further by installing the Image effects module. We used to do that in the previous Drupal 8 site although I am not proposing it here :)

@finnlewis
Copy link
Member

But even if I upload a 50MB file, the image styles will create the max width and scale the image proportionally, without the need for an additional crop.

My thinking is, the only reason to have a crop is if you wanted to allow the content creator to upload an image and select a proportion of the image rather than the whole thing. Is that the need here?

@Adnan-cds
Copy link
Contributor Author

if you wanted to allow the content creator to upload an image and select a proportion of the image rather than the whole thing.

That's right.

Sorry, my previous answer above totally missed the mark :(

@finnlewis
Copy link
Member

Cool, thanks for clarifying. It does make sense to me in that case!
It's good to explore though.
:)

@Adnan-cds
Copy link
Contributor Author

It's good to explore though.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants