DelazJ / MapsPrinter

A QGIS plugin to export simultaneously multiple print layouts to various file formats
GNU General Public License v3.0
23 stars 6 forks source link

Fix for world file not being generated #14

Closed Houska1 closed 4 years ago

Houska1 commented 5 years ago

Hi there. Downloaded yesterday for QGIS 3.6.2 (Windows). Super plugin!

I have found and solved one issue - when exporting to png, a layout's setting to generate a world file was not being respected.

The problem was in maps_printer.py, overrideExportSetings(). The current code if layout.customProperty('exportWorldFile') == True : exportSettings.generateWorldFile = True need to be changed to if layout.customProperty('exportWorldFile') == 'true' : exportSettings.generateWorldFile = True since the output of customProperty is a string not a boolean.

Not sure if this was a typo, or if these undocumented custom properties have changed since when you programmed it. In any case, for me with the above change it is fixed.

DelazJ commented 5 years ago

Hummm, Looking for the occurrences of exportworldfile in the code, I found https://github.com/qgis/QGIS/blob/release-3_6/src/app/layout/qgslayoutpropertieswidget.cpp#L60 and it sounds like a boolean. Anyway, will give it a look later. Thanks for providing a fix.

Houska1 commented 5 years ago

Hmm. Am just looking briefly in transit on my phone, but that 3.6 src line has .toBool at the end which may be forcing the translation - maybe that’s the solution. In any case I’ve added the string test and kept the bool test too and it’s working for me.

Sent from my iPhone

On Jun 21, 2019, at 09:27, Harrissou Sant-anna notifications@github.com wrote:

Hummm, Looking for the occurrences of exportworldfile in the code, I found https://github.com/qgis/QGIS/blob/release-3_6/src/app/layout/qgslayoutpropertieswidget.cpp#L60 and it sounds like a boolean. Anyway, will give it a look later. Thanks for providing a fix.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.