kolbyjack / MMM-Wallpaper

MagicMirror module to display wallpapers from various online sources
https://magicmirror.builders/
MIT License
99 stars 31 forks source link

Reuse the same module to display images that are not wallpapers. Adde… #60

Closed pallaire closed 2 years ago

pallaire commented 2 years ago

Reuse the same module to display images that are not wallpapers. Added a new config param to select if the module is used as wallpaper or simple image.

See usage example in the attached image. The module is used for both the wallpaper and the bottom left image. It's pulling images from a web server where I have security cameras. It's pulling every 2 seconds.

Library - 1 of 1

My configuration for this double use:

{
    module: "MMM-Wallpaper",
    position: "fullscreen_below",
    config: { // See "Configuration options" for more information.
        source: "http://localhost:1080/Mountain?crop=144,130,2700,1520",
        updateInterval: 10 * 1000,
        filter: "none",
        addCacheBuster: true,
        crossfade: false,
        wallpaper: true,
    }
},
{
    module: "MMM-Wallpaper",
    position: "bottom_left",
    config: { // See "Configuration options" for more information.
        source: "http://localhost:1080/FrontDoor?crop=0,0,460,360&rotate=270",
        updateInterval: 10 * 1000,
        filter: "none",
        addCacheBuster: true,
        crossfade: false,
        wallpaper: false,
    }
},

The wallpaper uses is still the default one and should work as before. For the new image use, you need to set wallpaper: false in the config file.

kolbyjack commented 2 years ago

I've been wanting to be able to do this for a while, but I think I want to implement it in a different way. Can you check out the fillRegion branch and see if that works for you? I think if you just change the instance you have in bottom_left to fillRegion: false, it will do what you want, since you're already getting a 360x460 image.

pallaire commented 2 years ago

Yeah it look similar, the idea being that we want a div that does set absolute position/dimensions.

kolbyjack commented 2 years ago

Solved in a different way