Help Needed: Manually created image does not display

Description

I can display images stored as C files without issue, but when I try to display a manually generated image I get nothing. I tried the example on the LVGL documentation (v9 master branch) but the code shown there it does not work with Arduino:

static lv_image_dsc_t my_img_dsc = {
.header.always_zero = 0,
.header.w = 80,
.header.h = 60,
.data_size = 80 * 60 * LV_COLOR_DEPTH / 8,
.header.cf = LV_COLOR_FORMAT_NATIVE, /* Set the color format */
.data = my_img_data,
};

After much digging I found an alternate way of declaring manual images that does not result in errors when compiling on Arduino IDE, but again, I get no image:

static lv_img_dsc_t snap = {
{
0, //always_zero
18, //length of image
18, //width of image
LV_COLOR_FORMAT_RGB565,
},
648, //size of data
img_map, //data
};

Any help on troubleshooting this issue is appreciated! Thank you!

What MCU/Processor/Board and compiler are you using?

I am running the Arduino Giga and Giga Display on the latest Arduino IDE

What LVGL version are you using?

v9

What do you want to achieve?

I need help fixing this code so that manually generated images can be displayed. Eventually, this code will be adapted so that a separate Arduino (connected to an ArduCam) can transfer an image to the Giga, which will store it as a uint_8_t and display it on the Giga Display.

What have you tried so far?

I’ve tried looking through the LVGL documentation and forum for examples of displaying manually generated images and found no direct solution. As mentioned, my current code uses a modified form for declaring the lv image as the default method in the documentation yields errors on the Arduino compiler.

Code to reproduce

Declaring the image variable, the array should make an orange-colored 18x18 pixel square:

uint8_t img_map[] = {
  0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3,
  0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 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, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 0x64, 0xf3, 
  };

This code declares the img_dsc and attempts to display it:

static lv_img_dsc_t snap = {
    {
      0, //always_zero
      18, //length of image
      18, //width of image
      LV_COLOR_FORMAT_RGB565,
    },
    648, //size of data
    img_map, //data
    };

    lv_obj_t * img1 = lv_img_create(lv_scr_act());
    lv_img_set_src(img1, &snap);
    lv_obj_align(img1, LV_ALIGN_CENTER, 0, 0);