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.

    HEIC and MMM-ImagesPhotos

    Scheduled Pinned Locked Moved Solved Troubleshooting
    20 Posts 3 Posters 4.3k Views 3 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.
    • R Offline
      rts58 @sdetweil
      last edited by

      @sdetweil I am still have trouble with some of the HEIC files.

      If the module runs across an unsupported HEIC (or corrupted jpg) file it will just stop and continue showing the last image.

      I couldn’t find any log or error for files that won’t open. I’ve compared the files it can and can’t open and don’t see any difference in the file details or exif data. Is there a way to have it just skip the unsupported file?

      The module does get locked up, it will not continue with a new image even after the update interval has passed. Thanks for your help.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @rts58
        last edited by

        @rts58 can you look in the developers window console tab

        ctrl-shift-i

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          rts58 @sdetweil
          last edited by

          @sdetweil yes I’ve been looking at it. If it works I’ll get a message that the image loaded and link, image setting size … , and setting top. If it doesn’t it won’t show anything.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @rts58
            last edited by

            @rts58 ok, i’ll look at error handlers

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R S 2 Replies Last reply Reply Quote 0
            • R Offline
              rts58 @sdetweil
              last edited by

              @sdetweil if it helps when I dig into the elements it shows:

              <img src="/MMM-ImagesPhotos/photo/module_9_MMM-ImagesPhotos/IMG_3259-Copy.HEIC" style="left: 0px; position: relative; opacity: 0;">
              

              So it thinks it is loading the file.

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

                @rts58

                in front of

                img.onload()

                add

                img.onerror(){
                   this.updateDom()
                }
                

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                R 1 Reply Last reply Reply Quote 0
                • R Offline
                  rts58 @sdetweil
                  last edited by

                  @sdetweil this is what I did which is creating an uncaught syntax error on the line with the first “{”.

                  	img.onerror(){
                  	this.updateDom()
                  	}
                          img.onload = (evt) => {
                            // Get the image of the event
                            const eventImage = evt.currentTarget;
                            Log.log(
                              `image loaded=${eventImage.src} size=${eventImage.width}:${eventImage.height}`
                  
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @rts58
                    last edited by

                    @rts58 im an idiot, sorry

                    better

                    img.onerror= ()=>{
                    	this.updateDom()
                    }
                    

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    R 1 Reply Last reply Reply Quote 0
                    • R Offline
                      rts58 @sdetweil
                      last edited by

                      @sdetweil I’m not seeing any errors in the console.

                      S 2 Replies Last reply Reply Quote 0
                      • S Offline
                        sdetweil @rts58
                        last edited by sdetweil

                        @rts58 i did not add error reporting yet, this should keep it
                        from stalling

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        S 1 Reply Last reply Reply Quote 1
                        • S Offline
                          sdetweil @sdetweil
                          last edited by

                          @rts58 the prior code started the timer only after
                          image was loaded. but we have already waited timeout time
                          so we can get the next image

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 1
                          • S Offline
                            sdetweil @rts58
                            last edited by sdetweil

                            @rts58 just pushed the updated code, git pull in the module folder
                            logs an error record to the dev window console on load fail, with the url of the failing image

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            R 2 Replies Last reply Reply Quote 1
                            • R Offline
                              rts58 @sdetweil
                              last edited by

                              @sdetweil great, thanks. I’ll let you know how it goes.

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                rts58 @sdetweil
                                last edited by

                                @sdetweil It’s working great now. No longer freezing on image files that it cannot open. And it is properly reflecting the error with the file name in the console! THANKS!

                                S 1 Reply Last reply Reply Quote 1
                                • S Offline
                                  sdetweil @rts58
                                  last edited by

                                  @rts58 awesome!!

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  1 Reply Last reply Reply Quote 0

                                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                  With your input, this post could be even better 💗

                                  Register Login
                                  • 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