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

make images fill 100% width of the screen, closes #1769 #1770

Closed
wants to merge 1 commit into from

Conversation

n-wissam
Copy link

@n-wissam n-wissam commented Jul 21, 2022

Image width is small and not responsive to to fill 100% of available screen width and you can notice that more in landscape mode and on larger screens.
The max-width property defines the maximum width of an image and it works if the image width is larger than the maximum available width . If the image width is smaller than the maximum available width, the max-width property has no effect.

See also #1769

Image width is small and not responsive to to fill 100% of available screen width and you can notice that more in landscape mode and on larger screens.
The max-width property defines the maximum width of an element and it works if the content is larger than the maximum width . If the content is smaller than the maximum width, the max-width property has no effect.
@gsantner
Copy link
Owner

this change "width:100%" also means that i.e. a small 32px icon gets full width icon.

Other ideas?

@n-wissam
Copy link
Author

this change "width:100%" also means that i.e. a small 32px icon gets full width icon.

IMHO that's totally fine since images are used mostly in markdown, not icons. and using width:325px; makes small 32px icon gets the same width as other images.
I have tried multiple markdown editors on desktop and I don't think one of them supports resizing images depending on if the image is an icon or a relatively larger image

@gsantner
Copy link
Owner

I'm not sure if generally resize to upscale is good. Setting max-width/height is so it not overshoots.

But generally if you have a camera picture, its already quite big usually, isnt it? (so it rather is downscaled to fit, then upscaled).

Just about behaviour on my device, with 350px as it is now. Fills 3/4 of width roughly in portrait. So about 420px would be filling already. Screen is fullhd. And when I rotate the screen, still I can see the image in full glance without it being chopped of. That is the intention behind this.

What I rather would try is a combination of max-width, no fixed width, and a max-vh. Assuming a square 500px img, it would already get width downscaled at portrait. Real small images stay as they are. For landscape, vh can be used to make image fit on screen page, but not sure how likable it is by users - depends on content.

@n-wissam
Copy link
Author

And when I rotate the screen, still I can see the image in full glance without it being chopped of. That is the intention behind this.

You are right I can see the image but it's small compared to available screen width like you see in the screenshot below:

IMG_20220722_122634_964

What I rather would try is a combination of max-width, no fixed width, and a max-vh. Assuming a square 500px img, it would already get width downscaled at portrait. Real small images stay as they are. For landscape, vh can be used to make image fit on screen page, but not sure how likable it is by users - depends on content.

I am sorry I didn't get what you meant here completely but if the purpose is just to scale down larger images and leave smaller images as they are why not stop using width:325px; ?

@gsantner
Copy link
Owner

I am sorry I didn't get what you meant here completely but if the purpose is just to scale down larger images and leave smaller images as they are why not stop using width:325px; ?

This is what I talked about. Removing 325 and having other means to limit the size to be viewable.

@gsantner gsantner added this to the Markor v2.11 milestone Jul 22, 2022
@gsantner gsantner changed the title make images fill 100% width of the screen make images fill 100% width of the screen, closes #1769 Jul 22, 2022
@gsantner gsantner closed this Aug 6, 2022
@gsantner gsantner assigned gsantner and unassigned n-wissam Aug 6, 2022
@gsantner gsantner assigned n-wissam and unassigned gsantner Aug 6, 2022
Copy link
Owner

@gsantner gsantner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made changes on my own here and it's on master.

Closing this.

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

Successfully merging this pull request may close these issues.

2 participants