When AMP is used in desktop version the amp-image-lightbox effect cause small images to stretch. Images tends to fill the whole screen but in desktop this feature makes images ugly. Is there any way not to exceed width and height of images?
Provide a clear and concise description of any alternative solutions or features you've considered.
Add any other context or screenshots about the feature request here.
^^ I think the whole point of the lightbox is to provide a higher resolution image to the user on click. so you need to supply a higher resolution pic and if not, you don't need a lightbox.
I could be wrong tho.
Yes it is. But the things is that lightbox is enabled by default in all images including featured image and small screenshots images that I use. Any way to avoid auto enabled lightbox?
Are you sure you are not talking about amp-image-gallery ? With amp-img-lightbox you have to manually specify which images to be lightboxed.
Yes; it was not happening before. I was manually enabling lightbox effect while editing post. Here is my site - https://sangams.com.np/
@2shrestha22
You can disable auto lightbox by setting the data-amp-auto-lightbox-disable attribute on any element. Set it on <body> to disable for the whole document.
Additionally, if you include the amp-lightbox-gallery extension script and use it explicitly by setting the lightbox attribute on a valid element, auto-lightbox won't apply.
@alanorozco
Thanks for the solution. Is it possible to makes image not fill the width and height instead show actual size of image.
@2shrestha22 I think that's probably a better use case for amp-lightbox than for amp-image-lightbox or amp-lightbox-gallery. Would styling your image for amp-lightbox work in this case?
Most helpful comment
@2shrestha22
You can disable auto lightbox by setting the
data-amp-auto-lightbox-disableattribute on any element. Set it on<body>to disable for the whole document.Additionally, if you include the
amp-lightbox-galleryextension script and use it explicitly by setting thelightboxattribute on a valid element, auto-lightbox won't apply.