Ultimatum22 / MMM-RandomBackground

Apache License 2.0
9 stars 9 forks source link

Request for resizing options #8

Open Arkoxs opened 7 years ago

Arkoxs commented 7 years ago

Hi @Ultimatum22,

Is it possible to add a configuration option for the resizing of the images? My display at the moment is 1920x1080 (landscape) and all images are resized to full width. Some of my pictures are portrait and therefore cut off at the top and bottom. I'd rather have two bar's on the side than losing part of the image.

Instead of manually having to resize my images an option to control this would be great.

Option Description --
Resizing How will the resizing of images be handled.
full-width Images are resized to fit the screen width default
full-height Images are resized to fit the screen height
other possible other option?
cverrill commented 6 years ago

Hi Arkoxs,

I found a way to do that. I went in and edited the MMM-RandomBackground.js file, and in the section where it's got loadImage: function()..., go down to the line that says backgroundSize: 'cover', and change to backgroundSize: 'contain'. This will fit the image to the screen in one dimension and leave black boxes for the top and bottom (or presumably left/right for the landscape display people).

Arkoxs commented 6 years ago

Confirmed, changing the backgroundSize in the MM-RandomBackground.js to contain will display the full image with black boxed on left/right. (I'm a landscape person.)