The image is not displayed



  • Hi Team,
    I was trying to display image with

    Widgets.Image('res/img/demo.jpg', 0, 0)
    demo.jpg is a 240x240 jpg file.

    the code runs without error, but no image is displayed as expected.
    But with Widgets.Image('res/img/uiflow.jpg', 100, 100), I can see the built-in image.

    Any advice ?

    Thanks,
    Joey



  • Well, somehow I download a 240x240 image from google, and it works fine.

    My images are converted from PNG files with ffmpeg command, any trick to make it work?



  • Nevermind, I get it work with this tool https://www.bytedig.com/web/image-resize



  • @codeblue said in The image is not displayed:

    Hi Team,
    I was trying to display image with
    Widgets.Image('res/img/demo.jpg', 0, 0)
    demo.jpg is a 240x240 jpg file.
    the code runs without error, but no image is displayed as expected.
    But with Widgets.Image('res/img/uiflow.jpg', 100, 100), I can see the built-in image.
    Any advice ?
    Thanks,
    Joey

    Hey Joey,

    It seems like you're trying to display an image using the Widgets.Image() function in your code. The fact that you can see the built-in image with 'res/img/uiflow.jpg' suggests that the function itself is working correctly.

    Make sure to check the following:

    File Path: Double-check the file path for 'demo.jpg' to ensure it's correct. It should point to the location of the 'demo.jpg' file on your device.

    File Existence: Ensure that 'demo.jpg' exists in the specified path and that it's a valid image file.

    File Format: Confirm that 'demo.jpg' is indeed a JPEG image and not another format like PNG or GIF.

    If all these checks are in order and you're still not seeing the image, there may be an issue with the image itself. Try opening 'demo.jpg' in an image viewer to make sure it's not corrupted or unreadable.

    Hope this helps you troubleshoot the issue!



  • Hello
    I'm having an issue showing images on M5Dail, i tried everything i can think of, i made sure its Baseline JPG, i can see the its saved here ( ' image1 = Widgets.Image("res/img/imgonlin1.jpg", 33, 42)')
    is there anything i'm missing? what Size it should be? i tried 32x32, 64x64, and 240x240 none worked

    the default.png (the place holder image before adding your own, shows just fine, but not uploaded ones)

    thanks



  • What pixel size and saved size in the image.
    240X240px images work but they have to be saved in a specific way.
    My little sheep Icon is an example of the image compression. it was designed for a proof of concept forum project and now M5Stack has implemented it into UIFlow2 firmware so that it show each users own logo.



  • the image is 240x240 but i did try different sizes
    the size is 8kb
    is there a software or a converter i can use to edit my icons?
    i tried to save your sheep icon and its also not displaying.
    I use InkScape for editing, maybe there's an option i can use when exporting



  • @iosapps420 I use GIMP for image editing.



  • @ajb2k3 said in The image is not displayed:

    GIMP

    thank you, i'm going to download it, what settings do you use when you export the image/icon?

    thanks