ErikHen / PictureRenderer.Optimizely

PictureRenderer for Optimizely CMS (former Episerver)
MIT License
13 stars 4 forks source link

Picture displayed as a square though should be a rectangle #16

Closed vilijatr closed 1 year ago

vilijatr commented 1 year ago

We are using Optimizely, CMS version 12 and have switched to to picture renderer from image processor . Now there is an image in the mega menu which is displayed as a square though it should be just a rectangle, it should not be cropped nor reshaped. image The css looks the same in the old and new solutions image In the html now we see that height is being added which previously was not. image Any suggestions why it is this way?

ErikHen commented 1 year ago

Hi, I'm guessing that the aspect ratio in your picture profile is set to 1. The value 1 means that width and height should be equal. Your wanted image width divided by your wanted image height is your wanted aspect ratio (ex. 640/480 = 1.33). See more samples here: https://github.com/ErikHen/PictureRenderer.Optimizely#1-define-picture-profiles

vilijatr commented 1 year ago

Ok, thanks. I thought if no profile was being specified it would show the image as it is. Created a new profile, added it to the partial view also the css class (it was not taking one from the cshtml) and now it looks correct.