🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Please help with persistent error message. Thanks...

    UiFlow 2.0
    5
    6
    1.5k
    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.
    • W
      wmatkins
      last edited by

      "Get res/img/UIFScreen2.JPG width and height failed"

      This is driving me mad. 26.9K properly formatted (baseline, no Progressive, 4:4:4 sample) JPG will not display in Uniflow 2.0.4 and returns error above. Background image is exactly 135 x 240 px for the M5StickC 2+. Displays OK in UIF but won't work when run.

      Would greatly appreciate any corrections or suggestions. Thanks...

      import os, sys, io
      import M5
      from M5 import *
      from boot_option import *
      from hardware import *
      from unit import NCIRUnit
      import time
      
      image0 = None
      TempF = None
      i2c0 = None
      ncir_0 = None
      
      def setup():
        global image0, TempF, i2c0, ncir_0
      
        set_boot_option(1)
        i2c0 = I2C(0, scl=Pin(33), sda=Pin(32), freq=100000)
        ncir_0 = NCIRUnit(i2c0)
        M5.begin()
        Widgets.fillScreen(0xec0865)
        image0 = Widgets.Image("res/img/UIFScreen2.JPG", 0, 0)
        TempF = Widgets.Label("TempF", 0, 105, 1.0, 0xe5ff13, 0x0838ec, Widgets.FONTS.DejaVu40)
      
        Widgets.setRotation(3)
      
      def loop():
        global image0, TempF, i2c0, ncir_0
        M5.update()
        TempF.setText(str((int(ncir_0.get_object_temperature())) * 1.8 + 32))
        time.sleep(5)
      S lbuqueL 2 Replies Last reply Reply Quote 0
      • S
        santtlorenzo @wmatkins
        last edited by

        @wmatkins Hello, have you solved it? I have the same problem and I don't know what happens with the images

        1 Reply Last reply Reply Quote 0
        • lbuqueL
          lbuque @wmatkins
          last edited by

          @wmatkins said in Please help with persistent error message. Thanks...:

          res/img/UIFScreen2.JPG

          Modify the file to res/img/UIFScreen2.jpg

          S 1 Reply Last reply Reply Quote 0
          • S
            santtlorenzo @lbuque
            last edited by

            @lbuque I have tried lowercase and uppercase, changing the file type and extension, also if you modify the original background the same error appears. Thank you

            1 Reply Last reply Reply Quote 0
            • A
              avildes
              last edited by

              I had the same issue today but was able to solve it by uploading the image file to my M5Stack before running.
              You can do it by opening the device file manager in UI Flow.
              Clicking it will open the console so you can link to your device and then you'll be able to find an icon on the console window helper to open the file manager.
              Upload the image to the folder you specified in code (it's not that fast but it works) and then run your project again.

              1 Reply Last reply Reply Quote 0
              • J
                JensH
                last edited by

                Hi All, I'm a bit late to the party. I've had this same issue this week. I downloaded one of the default images to see that it was indexed colour and 8 bit. I'm not sure if this is also the issue as I stopped testing after I converted all my images and found what I believe to be the issue.

                When you select an image it will be added to the project files. However, the code that is created from the UIBlocks shows it is trying to load an image from res/img/.... As soon as I uploaded the image to this folder, via the web terminal file menu, my issue was resolved.

                I realise this is a bit late for the others, but, hopefully, new comers may find it useful.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post