2

In QGIS 3.4.4.1 when exporting Print composer layout to image (.png, .jpeg) I get the following error message: "Cannot write to C:\xxxxx.png. This file may be open in another application". This file does not yet exist so is not open in another application. Exporting to .pdf and .svg works but export to image doesn't. Any ideas?

7
  • do you have permission to create files in c:\?
    – Ian Turton
    Commented Jan 28, 2019 at 13:16
  • Yep - running in admin profile
    – user127674
    Commented Jan 28, 2019 at 16:22
  • Do you have an older version of QGIS installed? If so, try exporting the same layout to the same location. That should tell you if it's a bug with the new QGIS version.
    – csk
    Commented Jan 28, 2019 at 17:05
  • I'd add a folder (c:\foldername\xxxx.png) or, just write to temp (c:\temp\xxxx.png). It may seem like you have permissions but root on c drive can be tricky.
    – enolan
    Commented Jan 28, 2019 at 20:40
  • @csk Yes previous versions of QGIS work fine
    – user127674
    Commented Jan 29, 2019 at 12:22

1 Answer 1

4

The fix would be to not include a period . in the output file name. I have verified this in QGIS version 3.6.2-Noosa

Example, if your print composer layout is named Atlas test-8.5x11, when you output a raster, then be sure to name the output file without any extra ., e.g., Atlas test-85x11.tif.

For vector output, such as PDF or SVG, you do not have to do anything different, as it will work as expected.

This QGIS issue, https://github.com/qgis/QGIS/issues/26308, titled Error exporting layout with "." (full stop) in filename mentions the error code

"Cannot write to <FILE_LOCATION>. This file may be open in another application." The file is not open in another application.


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.