1

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?

  • do you have permission to create files in c:\? – Ian Turton Jan 28 at 13:16
  • Yep - running in admin profile – DDK Jan 28 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 Jan 28 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 Jan 28 at 20:40
  • @csk Yes previous versions of QGIS work fine – DDK Jan 29 at 12:22
2

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, privacy policy and cookie policy

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