Skip to main content
Participant
May 19, 2022
Question

Saving SVGs with clip paths adds extra groups

  • May 19, 2022
  • 1 reply
  • 3188 views

When an AI file containing a shape (test.ai) with an image fill is exported as SVG (test.svg), a SVG group is created containing the shape's path with clipped sub-groups, defined using <defs>, containing the image. All well and good, apart from the fact that the shape's path is duplicated -- once in a <defs> element for clipping, once as the actual <path> -- and I suspect there's scope for optimisation.

If the saved SVG (test.svg) is resaved (as test1.svg) the groups above are wrapped in extraneous <g> elements -- one before each nested <defs> element, resulting in three additional nested groups. If test1.svg is saved again (as test2.svg) another three group elements are added.

Ongoing saving and opening a SVG eventually results in AI warning "There are too many nested groups than allowed in Illustrator. The file may not open correctly." and the shape's image fill is lost.

1 reply

Anshul_Saini
Community Manager
Community Manager
May 23, 2022

Hi @David24526970hc9e,

 

We are sorry for the trouble. This was a known issue that came with Ai 26.2.1 while exporting SVG containing images. But I am glad to inform you that we have tried to address the issue in v26.3.1, released recently. Let us know if that works. 

 

Regards,

Anshul Saini

Participant
May 23, 2022
Hi Anshul,

Thanks for responding. Unfortunately the issue exists with AI 26.3.1,
this being the version I used in my testing. In fact I suspect the issue
predates AI 26.2.1 as we noticed image fills sometimes disappearing from
SVGs late last year -- this has now become more problematic for us,
hence my investigation as to why.


Best regards,
Dave
Participant
September 12, 2022

Thanks for your testing and details info @defaulttz5ld9symjzi. For the other issue, it is a known Mar '22 bug that will be targeted for a fix in next month's release, and the current workaround for this specific issue is rolling back to v26.0.3, as mentioned & confirmed by other users as well on UserVoice, community, and Adobe chat support.

 

Regards,

Anshul Saini


Hi Anshul,

 

I've just retested with AI 26.5 and see that the problem (with extra SVG groups being added) still exists. When might we see a resolution of the issue?

 

Regards,

Dave