local pictures, displayed on the mirror.



  • Hello guys.
    Is there a modul, with i can load pictures (local path) from my raspbbery to the mirror?
    If not, can someone help me pleas? :)
    Thanks



  • On first thought this should be not too difficult to achieve.

    I would try something like

    getDom: function() {
        var wrapper = document.createElement("div");
        if (!this.config.imageurl) {
            wrapper.innerHTML = "ERROR";
        }else{
            var pic = document.createElement("img");
            if(!this.config.showColor){
                pic.className = "bw";
            }
            pic.src = this.config.imageurl;
            wrapper.appendChild(pic);
        }
        return wrapper;
    }
    

    and then use

    defaults: {
        imageurl: '',
        showColor: false
    }
    

    where the imageurl should default to the modules public directory if no “http” address is specified.

    in the css

    .MODULENAME img.bw {
      -webkit-filter: grayscale(100%);
    }
    

    would allow to convert to grayscale to fit in with the general design.

    Hope that gets you started :-)



  • Yes having a module like that would really be cool!! I could put my daughter’s pictures there… Never can see enough of my kid! :)



  • @GHLasse Thank you. I will test it later.


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.