MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-ImagesPhotos

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 2 Posters 2.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Do not disturb
      sdetweil @Nneuland
      last edited by

      @Nneuland no idea, I use it all the time and have sequential false…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @Nneuland
        last edited by sdetweil

        @Nneuland how many images?

        the algoritm use in IP is

        Math.floor(Math.random() * photos.length);

        math random is 0-1
        math floor rounds up (>0)
        it needs an whole number cause there is a 0-(num-1) list of images to pick

        so the smaller the list the more common the results will be

        I have about 150 images

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        N 1 Reply Last reply Reply Quote 0
        • N Offline
          Nneuland @sdetweil
          last edited by

          @sdetweil

          I have quite a few images. 260 i think. I suppose i could write a script to rename my images randomly as a work around. but we just curious if anyone has similar issues.

          thanks

          S N 2 Replies Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @Nneuland
            last edited by

            @Nneuland has nothing to do with the names…

            its purely count

            you could write quick js to test the results with 260 images

             let num_images=260
             const generate = () => Math.floor(Math.random() * num_images);
             let hash={}
             for(let i =0; i<num_images; i++){
             	 let t=generate()
               console.log("iteration ",i ," index ",t )
               if(hash[t]===undefined)
               	hash[t]=0
               hash[t]++
             }
             console.log("starting hash dump")
            for(let i =0; i<num_images; i++){
             	if(hash[i] === undefined)
             		console.log("found unused    at "+i)
             	else if(hash[i]===1)
             		console.log("found 1 use     at "+i)
             	else if(hash[i]>1)
             		console.log("found recurring at "+i)
             }
             console.log("done with hash dump")
            

            there were dups, and unused

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • N Offline
              Nneuland @Nneuland
              last edited by

              @sdetweil I’ll try that out. Thank you Sam!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy