Jump to content
You must now use your email address to sign in [click for more info] ×

'New from clipboard' copy has wrong viewBox and shape dimensions/positions


Recommended Posts

When copying shapes and use File --> New from Clipboard and export both original and copy to svg with exact same settings, the shapes's dimensions and locations are different. To compensate these changes Designer seems to compensate this by changing the size of the viewBox too so that the complete SVG looks the same when just doing that: watching the whole svg.

But that's causing issues and unneeded complexity when using the svg and its shapes inside for interactive usage online. Than 'New from Clipboard' renders the copy pretty much unusable when doing even a little more advanced stuff with the svg. I might be missing something, but to me it doesn't make sense to have the new file with a 75 x 75 viewBox, when the copied circle is 100 x 100 and the viewBox on the original is too. And also if I would have a wrong setting in the exporter set, I would expect both the original and the copy to export exactly the same.

Because of this everything in the exported svg (of the copy) is now different:

- sizes aren't the same
- locations aren't the same
- viewBox isn't the same

 

What I would expect to happen instead:

The viewBox to be the same size of the boundingbox of the vector-content in the clipboard, or size of an artboard or mask if this is clipping it. Than have the sizes of all curves (=paths) and shapes with the exact same attributes. Of course, positions may change when the copied content is smaller than the original document size, but in this case it's the exact same size, so also the locations should be exactly the same. Which would be easy if the viewBox of the copy would be the same.

 

Please see video below (+ SVG's as attachment):

copy.svg org.svg

Link to comment
Share on other sites

56 minutes ago, Hens said:

Windows uses 96 dpi for copy/paste
Maybe that's a part of the issue.
Affinity has a bug(imo) that the dpi used isn't ported over.
So if a document is 300 dpi and a picture on it too, it should copy at 300 dpi and paste (or new from clipboard) at 300 dpi but on windows it's 96 dpi and on mac it's 72 dpi

It indeed seems to be a dpi thing. When changing the DPI of the new file to 72 too it's exporting to svg as expected.

I wonder why Affinity isn't copying the DPI setting over to the new document, while it is perfectly known when we hit 'copy' and IMO could just take over that setting in the new file from the clipboard.

After a search I also found this thread about the same issue, but with only copy'n'paste:

https://forum.affinity.serif.com/index.php?/topic/95874-affinity-photo-changes-image-dpi-on-copy-paste/

I think the Affinity team thought it was a great plan to keep copies at 96dpi as some kind of a standard for when copies come from other software (if even possible), but didn't over see how confusing this can be for people only using Affinity just to create a copy of one or more isolated objects with File-->New from Clipboard. Causing the issues in the svg export as described above when not knowing about this underwater DPI change. Also the 'copy as svg' setting doesn't seem to have any influence on this.

IMO the best thing would be Affinity to just to copy the DPI setting to the clipboard when copying vector content and use it for the new file when using 'File-->New from Clipboard'. That would prevent issues and unneeded confusion. Or else at least show us a message that the DPI has changed, or might have been changed.

It's easy to forget these kinds of pitfalls and before you know you encounter the same issue again months later, having the same confusion again.

Anyway, good to know what's causing this for this moment. Thanks for your reply! Hope Affinity can address this for future versions.

Link to comment
Share on other sites

  • 1 month later...

I've just encountered a similar issue today which may be related. I'm working on a catalogue page from a PDF that contains material swatches. The PDF is 400dpi. Each swatch image is 2000px square. I open the PDF in Designer, select the graphic and CTRL+C top copy it to the clipboard. If I then switch to Photo and File | New from Clipboard I end up with a 472.4px square image in a document of the same size at 96dpi. On-screen the result is a pixelated low resolution image and at first glance it looks like the image has been resampled to a lower quality, however the original full resolution image is still there. Document | Resize document and setting the DPI back to 400 appears to solve the issue as does pasting the image directly into a new document. It is frustrating to have these extra steps.

File | New from Clipboard in Designer doesn't cause this to happen.

Link to comment
Share on other sites

  • Staff

Hi @Paul Mc,

Thanks for your report!

I've created a similar PDF document here and when copying the image from this file and using File > New From Clipboard provides the same results in both Affinity Designer & Affinity Photo - a 2000px square image at 96 DPI.

Can you please provide a copy of this PDF file so I can look into this further for you? :)

Please note -

I am currently out of the office for a short while whilst recovering from surgery (nothing serious!), therefore will not be available on the Forums during this time.

Should you require a response from the team in a thread I have previously replied in - please Create a New Thread and our team will be sure to reply as soon as possible.

Many thanks!

Link to comment
Share on other sites

Here's a sample which appears to reproduce it. Just a bit of background: the original file was a print-ready PDF from elsewhere - sorry I don't know which software package was used to produce it. That imported fine into Publisher and then each page was extracted and then layout changed in Designer. I was then asked to "brand" the swatches with some styled graphics and hence needed to take each swatch in turn into Photo which is when the problem was noticed.

To reproduce it here: import the PDF into Designer; select the swatch and copy; open Photo; File | Create from Clipboard

Page 5.pdf

Link to comment
Share on other sites

  • Staff

Many thanks for the file provided!

I can confirm this is simply the difference between rendering within Photo to Designer - if you set the zoom level to 100% for both 'New From Clipboard' documents, the sample image appears the same between the two apps.

image.png

When zoomed-in within Affinity Photo (which is set as the default zoom when creating the file), it appears more 'pixelated' due to anti-aliasing, but the documents are physically like for like in both apps :)

Please note -

I am currently out of the office for a short while whilst recovering from surgery (nothing serious!), therefore will not be available on the Forums during this time.

Should you require a response from the team in a thread I have previously replied in - please Create a New Thread and our team will be sure to reply as soon as possible.

Many thanks!

Link to comment
Share on other sites

Hi @Dan C thanks for the prompt reply.

I would agree that the underlying document is the same in both apps. I was able to create a similar image as you. However, from the UX perspective this set me off on a weird path this morning because the viewport display is misleading. I can see what's happening: the original image is 2000x2000px @406dpi you divide by the 406 and multiply by 96 to get 472 (rounded). So my 2000px image is resampled down to a 472px square. Plus, the difference between how the apps work when displaying the image means that the extra resolution available in the source image is hidden from view in Photo because of the resampling.

Where does the idea or the design decision come from that says that users must have a 96 dpi document when pasting from the clipboard into a new document? If I was pasting into an existing open document that was set to 96ddpi then maybe that's not unreasonable - however this is a new document. My expectation was that I'd see a 1:1 pixel image i.e. a new document of 2000x2000px - at any dpi as it makes no difference. If anything, because you are taking note of the source DPI, why isn't it set to 406dpi in my example?  After New from Clipboard I saw a resampled image using the 96dpi formula above and document dimensions of 472x472px. The pixelation and blurriness was due to resampling the image twice (once to scale for the document and a second time to scale for the viewport zoom) not antialiasing.

I think this has caused several problems for me in the past and is only starting to become clear now that I'm experimenting with this today. I would love a Preferences parameter that says something along the lines of ignore source DPI when pasting images. Additionally, a New from Clipboard as a pixel layer document menu option would be great too, assuming that would create a 1:1 pixel document from the source irrespective of either DPI and without resampling i.e. not an Image layer. Alternatively - paste as Pixels in addition to the existing paste as Image might also be helpful.

Link to comment
Share on other sites

  • Staff

I certainly understand the frustration here, and it is logged with our developers as an improvement to the app to retain the source document DPI when using File > New From Clipboard, so I'll be sure to add a 'vote' to this feature for you now!

20 minutes ago, Paul Mc said:

Where does the idea or the design decision come from that says that users must have a 96 dpi document when pasting from the clipboard into a new document?

As I understand it, this is retained from legacy Windows OS's & monitors which used to be 96dpi as standard. Windows uses an 'internal resolution' of 96dpi for font display, which is covered at the below link -

http://www.frankschrader.us/image-resolution-72ppi-vs-96ppi-vs-300ppi/

(both under 'WEB IMAGE RESOLUTION: 72 PPI / DPI? – DOES IT MATTER? WHERE DOES IT COME FROM?' '72DPI / 96DPI INTERNAL RESOLUTION' subheadings)

Please note -

I am currently out of the office for a short while whilst recovering from surgery (nothing serious!), therefore will not be available on the Forums during this time.

Should you require a response from the team in a thread I have previously replied in - please Create a New Thread and our team will be sure to reply as soon as possible.

Many thanks!

Link to comment
Share on other sites

  • 4 weeks later...

Just hit with this weirdness today myself with Designer (1.10.5) on my Mac (10.14.6)

Copied a simple 4" square from a 300dpi doc with inches as the ruler unit. New from Clipboard brought it in as a 1200px square at 96dpi with pixels as the ruler unit.

Link to comment
Share on other sites

  • 1 month later...

I know this is not exactly the issue described here but it has to do with the same deficiency so I am adding my request here:

What I would love to see is to be able to change pixels and dpi in the document settings and have an extra field that shows the printing size in i.e. cm and optionally inch. In my old photoshop days I loved to change dpi and and see the actual size of the document in cm while leaving the pixel dimensions unchanged and vice versa. It's a very handy tool and I often need that when creating a new document from the clipboard. I can immediately tell if the resolution is sufficient for my purpose. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.