gazebosim / gz-gui

Builds on top of Qt to provide widgets which are useful when developing robotics applications, such as a 3D view, plots, dashboard, etc, and can be used together in a convenient unified interface.
https://gazebosim.org
Apache License 2.0
66 stars 39 forks source link

Fix QImage's step size in ImageDisplay plugin #602

Closed iche033 closed 7 months ago

iche033 commented 7 months ago

🦟 Bug fix

Fixes https://github.com/gazebosim/gz-rendering/issues/945

Summary

The QImage constructor that was used expects the images are 32 bit aligned. This is not true for our RGB_INT8 formats. (24 bits) The PR fixes the issue by explicitly specifying the bytesPerLine field in the constructor.

Tested with camera_sensor.sdf world by changing the image width to be 321 (from 320)

Before

image_display_before

After

Image_display_after

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

iche033 commented 7 months ago

gz_gui-ci-pr_any-focal-amd64 test failures look unrelated.