Don't duplicate cloned image data in pdf export
Steps to reproduce:
- open Inkscape
- paste an image, preferably one around 500-700 kB (allows better viewing of bug without crashing)
- save as PDF (I saw no difference between Save, Save As and Save Copy)
- use the Tiled Clones tool to create some clones (I think cloning manually also works to reproduce the bug)
- save as PDF to a different file
What happened?
The two PDF files have very different sizes. It appears that Inkscape is dumping the image data inside the PDF file for each of the clones, because the file size is roughly equivalent to the original image size times the number of clones (plus the original size itself, if its object hidden below the first clone).
What should have happened?
The output PDF file should use the PDF data referencing system to avoid duplication of image data. With this, the PDF uses references/pointers to the image data, which is stored only once. Since Inkscape does know that the images are clones, usage of this resource is the expected behavior. Not using it may create huge files, which also load slowly in PDF readers and take longer to download if they're supposed to be distributed online.
Inkscape Version and Operating System:
- Inkscape Version: Inkscape 0.92.4 (5da689c313, 2019-01-14)
- Operating System: Windows 10 Home
- Operating System version: Version 1903 build 18362.657