Photoshop: "Export as" SVG doesn't export vector SVG

  • 1
  • Problem
  • Updated 1 year ago
  • (Edited)
I'm trying to use "Export As.." for Smart Object layers and layer groups containing vector shapes and Smart Objects to export true vector SVGs since my layers are vector and it's an option in "Export As..".

You can see here that my layers are actual Vector Smart Objects:



When I export the SVG and open it in Illustrator, the vector path/shape is a vector, but the Smart Object is turned into an :



If I export a group containing only Smart Objects, they are both turned into s:



Even if I export only a single, non-grouped Smart Object layer, it gets turned into an layer within the .svg file that gets exported:



I know the "Export As.." function already has a known bug in 2015.5 (https://feedback.photoshop.com/photoshop_family/topics/2015-5-update-breaks-asset-generator-inconsis...), but this SVG problem was happening in the previous version as well. Though I'm not sure about versions before that.

Is this also a known bug?
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like

Posted 2 years ago

  • 1
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
This is still an issue even after the 2015.5.1 update that supposedly fixed the "Asset Generator" bug, specified here: https://feedback.photoshop.com/photoshop_family/topics/2015-5-update-breaks-asset-generator-inconsis...

Is there any news on the cause of this bug, or a possible fix? It's having far-reaching repercussions because Zeplin's Photoshop plugin utilizes this "Export As.." function when defining assets for its styleguides.
(Edited)
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 150 Reply Likes
This is more feature request than bug. "Export as" is based on java scripts and you can't simply read inside of smart objects with these scripts. Especialy not Illustrator smart objects. Script can access only to layer bitmaps and layers settings. Not content inside. And this is reason why is smart object exported like bitmap. Because it is easy way for developers. 

The code where is decision what to do with layer is here: c:\Program Files\Adobe\Adobe Photoshop CC 2015.5\Required\Plug-Ins\Generator\crema.generate\node_modules\svgobjectmodelgenerator\svgOMGenerator.js (or place where you have installed PS)
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
Hi Jaroslav, thanks for the reply.

What exactly is the point of having the option to export to SVG if all that can be exported are bitmap images? Isn't the purpose of SVGs to have a vector? I just tried exporting a vector shape/path(not an Illustrator smart object) using "Export As.." and even that only exports as a bitmap.

The fact that SVG(scalable VECTOR graphic) is even an option in "Export As.." means this really is more of a bug/problem than a feature request. I can no longer edit my original post above to change it to a feature request.

Again, I appreciate your reply. Just seems like this is something that should get figured out.
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 150 Reply Likes
I don't disagree with you. I am just explaining situation.

You can export Shape layers as non-bitmap vector SVG and also text. And it is sometimes buggy. And that is all what you can save as vector. 

If you want vector smart object as scalable vector, then you need copy/paste all shapes from Illustrator to Photoshop and it must be as shapes layers not vector smart objects.

It is not elegant, but it should works. Maybe I will do some script or plugin in future which could read SVG as shape layers and not vector smart object. But it will be a bit difficult :-D 
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
I hear you. Thanks for replying.

As you said, "...And it is sometimes buggy. And that is all what you can save as vector..."

My original post was to address this bugginess and suggest a more straightforward "Export As.." option that does what it advertises. That's all.

Copy/paste-ing a vector as a Photoshop shape layer isn't a good workaround because editing vectors in Photoshop is the worst, and easy syncing of original vector artwork is the point of having smart objects at all. I don't think it's too much to ask that both apps work in harmony between editing(as they currently do) and then exporting assets. I also realize these apps are always a work in progress. That's why I'm suggesting the update here :)

Does any Adobe rep have some insight or info?
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
Looks like this is an issue outlined here: https://github.com/adobe-photoshop/generator-core/issues/285

This Github issue is in relation to the Avocode plugin, but it doesn't seem PS can do it itself either. Exporting a smart object to svg via these plugins(Zeplin and Avocode) results in the same type of "svg-contained bitmap" as exporting from PS. Can anyone confirm these issues are all related?
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 755 Posts
  • 149 Reply Likes
There are two different types of smart objects.
1) Photoshop Smart Objects editable only with Photoshop
2) Illustrator Smart Objects editable with Illustrator placed into PSD

And I think the whole discussion on Git Hub is about first case. In that case you could be able read Photoshop shape layers inside smart object. But not Illustator vectors inside vector smart object. In both cases wrap about content is similar. But content should be different.

If you look into PSD binary then smart object looks like document inside document. And you can read with Script PSD content byte after byte both contents without opening smart object as new document in PS UI. But document must be saved. I don't know how to access memory. And this is f*cking hard if you want do it correctly without bugs :-D 

PSD spec: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
AI spec: http://partners.adobe.com/public/developer/en/illustrator/sdk/AI7FileFormat.pdf
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
Would love to hear any sort of reply on this issue from someone at Adobe.

EDIT: Following this older topic as it concerns the same problem. Hopefully progress/updates will be made there: https://feedback.photoshop.com/photoshop_family/topics/extract-asset-to-svg-via-photoshop-from-vecto...
(Edited)
Photo of Dave Mozdzanowski

Dave Mozdzanowski

  • 24 Posts
  • 1 Reply Like
That looks like a very useful plugin. I appreciate the link.

Again, though, this is a Photoshop feedback forum. Photoshop and Illustrator are products from the same company. Photoshop offers an "Export as..." SVG option. So logic would dictate that these two programs *should* be able to communicate well enough with each other to utilize the unique file-type features of which they are offering.

I get the fact that they are fundamentally different file types, and that communication/transfer between the two may have never been intended. That idea, though, is very outdated, and if Adobe takes their future seriously I would think feedback such as this to modernize these workflows would be valued, not received negatively. That's all I'm saying.

I really appreciate your insight into the inner workings of these two programs, and offering work-arounds, but I'm simply another(https://feedback.photoshop.com/photoshop_family/topics/extract-asset-to-svg-via-photoshop-from-vecto...) designer who is expecting one result and is getting another.

Thanks!