Pomax / photoshop-paths-to-SVG

This is a photoshop "jsx" script that turns all paths in the active document into a single SVG file for use in something else.
32 stars 7 forks source link

Incomplete path export #3

Open cyqsimon opened 4 years ago

cyqsimon commented 4 years ago

Not sure if you intend to maintain this tool or not, but in case you do, I think I found a bug.

I was trying to use your script to grab this following path in .svg because PS's export function simply gives an <image> tag and no path.

Screencap-001-20200313-182739

I ran the script and there were no errors thrown, but the svg I got was incomplete:

Screencap-001-20200313-183017

I suspect it's because I constructed the several parallelograms on the top right using two big beizer curves to form a big 'curly parallelogram' first, then split it into the smaller ones with horizontal line segments. And perhaps PS stores this kind of path differently, and your script missed this edge case. Anyways, those are my educated guesses. Here are my .psd and .svg files if you want them for debugging. Thanks.

files.zip

Pomax commented 4 years ago

No real support intent, but it's not like we're not all stuck inside right now, so I might as well have a look =)

Pomax commented 4 years ago

It looks like that really is the "true" path: walking the document's pathing object, if I remove the Z and the lower-right rectangle, theres only 1 path left, with 1 subpath, and that subpath only has 4 points (the four for the lowest "rect").

However, there's some masking weirdness going on, too: if you select the text tool and hover it over your path, you'll see it change from the standard text placement icon to a circular text placement icon when inside any of the "rects" and clicking will invalidate all but the one you clicked, prefilling that shape with lorem ipsum text.

So I think the issue here is that what we're seeing is not the true path, but some kind of vector mask, and it doesn't actually have path points. And I'm not sure what exactly it would be or how to script getting the resulting "virtual path" in this case.

cyqsimon commented 4 years ago

Thanks a lot @Pomax for your time.

Too bad then I guess. It is a proprietary format after all. What to do. I ended up manually tracing the missing paths in Inkscape - wasn't a big deal for such simply shapes.

I guess I'll keep the issue open in the off chance that someone else decides to fix it. Cheers.

Pomax commented 4 years ago

If you have illustrator and Photoshop then there will be no need to redraw anything: they're both Adobe applications. You can just select the paths you want in PS, hit copy, select your Illustrator document, and hit paste.

But yeah if you rely on Inkscape or other not-Adobe applications, no such luck =(

Pomax commented 4 years ago

I filed https://community.adobe.com/t5/photoshop/ps-scripting-getting-all-path-points-that-are-visible-in-the-layer-but-not-in-pathitem-pathpoints/td-p/11027950 in case someone on the Adobe forums knows what's going on.