Hi all,

I have a layout on which I checked the "save world file" option in Layout
--> Exports settings
When I export this layout to image, I'd expect it to generate a world file
next to it considering that the generateWorldFile is an attribute of the
*ImageExportSettings* class [0]. But no world file. I use this kind of code

mylayout=QgsProject.instance().layoutManager().layoutByName('Composeur 1')
exporter = QgsLayoutExporter(mylayout)
exporter.exportToImage(filePath, QgsLayoutExporter.ImageExportSettings)

and then I check the image export settings with the next code

ls=QgsProject.instance().layoutManager().layouts()
for elt in ls:
  exporter = QgsLayoutExporter(elt)
  imgSettings = exporter.ImageExportSettings()
  print(elt.name(), imgSettings.generateWorldFile)

which returns False for any layout, including the one I checked the option
for. Btw, dpi returns -1.0, pages return an empty list... I guess I might
have missed something but...No idea.
When is the generateWorldFile set to True (if ever it's what will trigger
my world file export)?

[0]
https://qgis.org/pyqgis/master/core/Layout/QgsLayoutExporter.html#qgis.core.QgsLayoutExporter.ImageExportSettings

Thanks for your help,
Harrissou
_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to