Is there any problem with image scaling?

@Anda
Sorry for the late replay. The past days were crazy here…

First of all, thank you for the investigation in this topic. I’m more active on GitHub, and in the future, if you find similar issues (related to under-development features) feel free to open an issue on GitHub.

Can you explain how your fix work? I calculated the result wit 3 values (width = 100) but can’t get the point:

  • 50%: ((100 * 128) + 255) / 256 = 50.99 -> 50
  • 100%: ((100 * 256) + 255) / 256 = 100.99 -> 100
  • 200%: ((100 * 512) + 255) / 256 = 200.99 -> 200

So seemingly it’s equivalent to width * zoom / 256

Thanks for your reply.
That’s all right.
Now I show you my modify like this
e.g.
img_origin_size : 60 * 60
my code: lv_img_set_zoom(img, 100)

@lv_img_draw_core(…)

@kisvegabor

Got it, with zoom = 100, it really gives different result.

Can you send a Pull request with the fix?

Fine, but I’m not sure if it completely fixed the issue.

It seems logical to round up the size to deal with the edges too.
Maybe your solution is not a full solution to the problem but definitely an improvement. So, I’d happily merge the PR! :slight_smile:

Very good. :grinning:
I am also looking forward to the release of an updated version.