Lv_img_set_angle() causes distortion or flip when rotating .bin image in LVGL v8

Description

When using LVGL v8 to load images converted with the LVGL Image Converter (in .bin format), the image displays correctly by default, but becomes distorted or appears “flipped”/“mirrored” when rotated using lv_img_set_angle().

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

esp32c3

What do you want to achieve?

  • LVGL version: v8
  • Image format: generated using LVGL’s official Image Converter, output as .bin
  • Color format: LV_IMG_CF_TRUE_COLOR (or TRUE_COLOR_ALPHA)
  • Image renders correctly before rotation
  • After rotation, the image appears as a thin line or looks like it’s been “flipped” or “mirrored”
  • bin file format images can be rotated correctly

What have you tried so far?

The generated C code image can be rotated normally, but the bin image cannot

Code to reproduce


    // 获取当前屏幕
    lv_obj_t *scr = lv_disp_get_scr_act(disp);

    // 创建图像对象
    lv_obj_t *img = lv_img_create(scr);
    lv_img_set_src(img, "A:/littlefs/moiw_2014.bin"); // 使用LittleFS中的图像文件
    // lv_img_set_src(img, &moiw_2014); // 使用LittleFS中的图像文件

    // 设置图像中心对齐
    lv_obj_center(img);

    // 允许旋转和缩放(开启变换属性)
    lv_img_set_pivot(img, 100 ,100); // 设定旋转中心
    lv_img_set_angle(img, 0); // 初始角度:0°

    // 创建动画旋转图像
    lv_anim_t a;
    lv_anim_init(&a);
    lv_anim_set_var(&a, img);
    lv_anim_set_values(&a, 0, 3600); // 单位是0.1°,3600 = 360°
    lv_anim_set_time(&a, 3000); // 3秒一圈
    lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
    lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)lv_img_set_angle);
    lv_anim_start(&a);


Screenshot and/or video

If possible, add screenshots and/or videos about the current state.
VID_20250511_165234
image
moiw_2014