NINAnor/GarminCustomMaps

Crash with zoom != 1.0 running QGIS in debug mode

Opened this issue · 1 comments

nirvn commented

First, nice plugin, thanks!

When running QGIS in debug mode (where ASSERTs will kill the app), the plugin causes QGIS to die when the zoom != 1.0. That's because the painter's DPI doesn't match the output DPI.

The way to fix this is to declare a DPI in the QImage used to paint the map:

                # create output image and initialize it
                image = QImage(QSize(width, height), QImage.Format_RGB555)
                image.setDotsPerMeterX(target_dpi / 0.0254);
                image.setDotsPerMeterY(target_dpi / 0.0254);
                image.fill(qRgb(255, 255, 255))
esan0 commented

@nirvn could you test the latest version of the plugin and report back whether you are seeing the same error or not?

Thanks