[go: up one dir, main page]

Batch Export overwrites files without warning

Summary:

Batch Export PNG re-writes PNGs exported from other files.

I need several PNG images with transparent borders around them. For this, I made a template file with rectangles. After drawing my images, I select those rectangles, hide the template layer, and do batch export.

Today I've installed Inkscape ver. 1.01 and after exporting my PNGs, I discovered that out of 6 objects, 3 new PNGs were created (in the same folder where my SVG was) and 3 of my old PNGs (exported from a different file, from the earlier version of Inkscape, and located in a different folder) were replaced without even a warning.

My guess starts

I guess the following happens: when an object is created, Inkscape assigns a name to it (rectXXX, imageYYY, or whatever). During Batch Export, Inkscape uses that name to generate PNGs. Also, if you previously exported a single PNG for some object, Inkscape remembers that PNG's filename and will use it in Batch Export. The problem arises when we copy images from file to file or create a new file using Save As. When an object is copied, its name stays the same, and Batch Export PNGs' default names will be the same, so Batch Export will re-write existing files. If the copied object has a PNG file name associated with it, Inkscape will use it.

My guess ends

So, what I did exactly:

  1. Create a template with a rectangles layer
  2. Create a file using that template
  3. Export PNGs for several objects one by one
  4. Create a new SVG using Save As
  5. Delete some layers, add some layers and draw some images
  6. Batch Export images -> got a mess.

Steps to reproduce:

As you asked, the minimal version.

  • open Inkscape
  • draw several objects (batch_export_bug_1.svg)
  • use Batch Export
  • create a new file
  • copy objects from the old file to the new one (batch_export_bug_2.svg)
  • use Batch Export

What happened?

PNG files from the first Batch Export are re-written.

What should have happened?

  1. Batch Export should NOT re-write PNGs exported from other files!
  2. Batch Export should at least give a warning when replacing files, with the option to cancel the export.
  3. To be useful, Batch Export should either attach SVG file names (original-svg-rectXXX.png) or create a new folder (original-svg\rectXXX.png)

Sample attachments:

Version Info:

- Inkscape Version: 1.0.1 (3bc2e813f5, 2020-09-07)
- Operating System: Windows 8.1
- Operating System version: 64
Edited by Nathan Lee