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

Images lock aspect ratio not function #548

Closed
NicoHood opened this issue Oct 28, 2021 · 5 comments
Closed

Images lock aspect ratio not function #548

NicoHood opened this issue Oct 28, 2021 · 5 comments
Labels
question Further information is requested

Comments

@NicoHood
Copy link
Contributor

Version:

  • listmonk: 2.0.0

Description of the bug and steps to reproduce:

  • Insert a picture (url) with 1200x628px and select keep ratio in the editor.
  • Preview the image and you will see the image size is incorrect.

Screenshots:
grafik

Possible Solutions

  • Fix the css so that images are displayed correct.
  • The button "lock aspect ration" also requires a fix or must be disabled I guess.
  • Shrink the image on upload? Or reprocess external images?
@NicoHood NicoHood added the bug Something isn't working label Oct 28, 2021
@knadh knadh added question Further information is requested and removed bug Something isn't working labels Oct 28, 2021
@knadh knadh closed this as completed in 9dd8592 Oct 28, 2021
@knadh
Copy link
Owner

knadh commented Oct 28, 2021

The default template has a max width of 525px. Any image size beyond this will get squished. You can edit the default template and change this or increase the width of the template if you want wider images:

            img {
                max-width: 100%;
            }

to

                max-width: 100%;
                height: auto;

@NicoHood
Copy link
Contributor Author

I also found out, that this is the solution. Lets make it a default? You've fixed it. Pretty fast! Super nice! Thanks!

@NicoHood
Copy link
Contributor Author

Is there also a way to keep (crop) to the aspect ratio that was entered via the editor? For example I'd like to crop to a common feature image size of 1200x628px. That is written in the html, but if the image itself is of another aspect ratio, this is not respected. I know object-fit: cover is related to this solution, however I am not sure if the dimensions from the html itself can be useful at all for that.

Example:
grafik

Desired result (dont know how to do that):
grafik

@knadh
Copy link
Owner

knadh commented Oct 29, 2021

If you want to maintain the dimensions you entered in the editor, you can remove the max-width and height bits from under img in template CSS entirely.

@NicoHood
Copy link
Contributor Author

I want to have aspect ratio, but the dimension itself, as it would be way too large. Not sure if that is possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants