maxisam / ngx-progressive-image-loader

lazy load img/picture, prevent reflow and seo friendly.
MIT License
35 stars 6 forks source link

Possible to use a flexible imageRatio (none stretch) #7

Closed AndreasSchmid1 closed 5 years ago

AndreasSchmid1 commented 5 years ago

I try to use progressive images to load thumbnails which can be at any aspect ratio. Before using ngx-progressive-image-loader I was able to implement this successfully with Flexbox.

` .thumbnailContainer { flex: 2 ; overflow: auto; position: relative;

} img { position: absolute; top: 0; bottom:0; left: 0; right:0; margin: auto; max-width: 100%; max-height: 100%; }`

`

              </div>`

My code matched to the lib looks like this. Unfortunately it doesn't work because the images get stretched to a specific aspect ratio

`

              </ngx-progressive-image-loader>`

Thank you very much for help in advance.

maxisam commented 5 years ago

i don't think it will work for your case unless you know the ratio before hand. You can change the ratio but it need to know that before it loads an image

AndreasSchmid1 commented 5 years ago

Bad luck for me . Would that be a possible feature request or does that not fit into the strategic development of the lib ?

maxisam commented 5 years ago

Well, I think it is more like a limitation. Currently, I don't see a way to do it.

AndreasSchmid1 commented 5 years ago

ok thanks for your feedback!

maxisam commented 5 years ago

If you figure out a way, feel free to make a PR. Thx.

AndreasSchmid1 commented 5 years ago

ok yes. i found out that there is a lib called "ng-lazyload-image" which is able to do it.