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

New System Thumbnail and Image Interface Preview #9162

Closed
benhaynes opened this issue Oct 26, 2021 · 8 comments · Fixed by #9628
Closed

New System Thumbnail and Image Interface Preview #9162

benhaynes opened this issue Oct 26, 2021 · 8 comments · Fixed by #9628

Comments

@benhaynes
Copy link
Sponsor Member

Source image (landscape):

og-image

Full width preview:

Screen Shot 2021-10-26 at 11 53 47 AM

The problem is that Directus first creates a square cropped thumbnail... and then sets this to cover within the interface. This double crops it and looks horrible. We need to add a second system thumbnail that is set to contain (800 wide by 450 tall, ~60% quality, no cropping) and add an Interface option for fit: cover (or crop?) and contain (centered)... both of these would use the new un-cropped system thumbnail.

@rijkvanzanten
Copy link
Member

We need to add a second system thumbnail that is set to contain (800 wide by 450 tall, ~60% quality, no cropping)

For implementation: the desired effect is most likely "inside" instead of "contain" to prevent blackboxing the image

@azrikahar
Copy link
Contributor

cc @licitdev

@licitdev
Copy link
Member

licitdev commented Nov 8, 2021

@benhaynes Is this what you're looking for?

Screenshot 2021-11-08 at 7 14 27 PM

@benhaynes
Copy link
Sponsor Member Author

benhaynes commented Nov 8, 2021

@licitdev Yes! That solves one issue, which is that the thumbnail was double-cropping... thank you!

The other issue is that this version still crops the top and bottom. I think we want to give users the option to show an uncropped version, centered, and with "letter-boxing" to fill in the sides. To enable this uncropped option, I think we'll need to generate a second system thumbnail that uses "contain".

This would also allow the File Library to have an option controlling "Crop" / "Contain".

Does that make sense? I can answer questions or provide designs as needed!

@benhaynes
Copy link
Sponsor Member Author

Oh, I just realized we already have a BUNCH of system thumbs!! We can just use these, but should add options to the Interface/Layout for which you want.

https://github.com/directus/directus/blob/main/api/src/constants.ts#L3-L28

@benhaynes
Copy link
Sponsor Member Author

Aaaand, hopefully this helps, it should close this issue (although I'd like to have the same thing for the Card Layout).

#9628

@licitdev
Copy link
Member

licitdev commented Nov 9, 2021

@benhaynes Tested your fix, works very well! 👍🏻👍🏻

Aaaand, hopefully this helps, it should close this issue (although I'd like to have the same thing for the Card Layout).

Not sure if this is what you meant, the crop / contain setting exists in the Card Layout.

image image image

@benhaynes
Copy link
Sponsor Member Author

Haha, of course it is... 🤦

This issue is all set then!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants