ExportOptionsPNG24.artBoardClipping broken in 2020
ExportOptionsPNG24.artBoardClipping (set to false)
In 2019 (23.1), PNGs exported by javascript are trimmed to the visible bounds of the object as expected when false. When true, they're the size of the artboard.
In 2020 (24.3), the same script always produces PNGs the size of the artboard whatever artBoardClipping is set to.
Illustrator 24.3 vs Illustrator 23.1
Windows 10
Script run via Illustrator (File/Scripts) as well as testing in ETSK 4.0.0.1
It's a dealbreaker for version 24. We can't upgrade as a team unless this is fixed.
I am happy to share that we have fixed this bug in our latest release – 25.3.1 which is available worldwide now.
Going forward, our goal is to fix as many top User-Voice bugs as possible and as frequently as possible. Given the nature of the fixes, some of the bugs will take a longer time to fix, but we are on it.
You can update to the latest release using Creative Cloud desktop App: https://helpx.adobe.com/in/creative-cloud/help/creative-cloud-updates.html
Thank you for all the feedback. Keep it coming!
-
Brad commented
This issue was resolved (for me at least) with one of the updates early in 2021. My current version is 25.2.3 of Illustrator 2021.
Once this issue emerged, all of the Illustrator 2020 updates that followed were useless. For me, I kept the 2019 version installed that did work and also installed one of the 2020 versions and would update the 2020 version as updates came out. But I still did daily work in the older version. Finally, one of the early updates labeled as "Illustrator 2021" worked. At that point I uninstalled all other versions and everything has worked fine since.
-
MDN commented
Volker - I've spoken to support a few times now and although they say they're aware of the bug, the answer is no, they've not been able to give me a timeline or any updates on their progress with it.
I was frustrated to say the least to see the list of changes on the most recent update: 6 items, three of which were Mac only, and the other three were minor to the point of irrelevance, compared to this show-stopper we've been putting up with for over a year now. The team I work with and I are all stuck on 23.1 (2019).
-
Volker commented
I can confirm this bug for Illustrator 25.1 as I'm also affected. Is there any timeline for fixing it?
-
Brad commented
I reported the same problem and included details with images at this link in Adobe forums:
https://community.adobe.com/t5/illustrator/save-png-with-transparency-clipped-to-visible-art-only/m-p/11468034?page=1#M246205 -
Mark Nicoll commented
@Ankit goyal(Illustrator Team)
I've attempted to help you narrow down the cause - please see the attached png for a visual explanation of the tests and results for situations that trigger this error.
The issue is triggered by *any* non standard appearance on a hidden object on a layer above the one being exported. By "non standard", I mean anything other than a single stroke and a single fill. This includes all effects, arrow heads, additional strokes and fills.
It's interesting to note that all the things (I've tested so far) which trigger this issue (in AI 24 and 25) are also all things which are inaccessible via the scripting API.
-
MDN commented
I have spoken to suport (Priyanka - very helpful) who report that issue is being worked on.
Cheers.
-
Mark Nicoll commented
It turns out this is a general issue with exporting PNG in versions 24 and after. You can replicate it with Export As, Export for Screens, and Save for Web.
Just save a file with two objects in different locations, hide one of the objects and export a PNG.
For expected behaviour, follow the above steps in 23.1. Do it in 24.3 and 25.0 to see the problem.
-
MDN commented
I have now read quite a number of similar reports of wrongly clipped PNGs in 2020 and 2021. The specific issue we're talking about here is hidden objects included in the dimensions of the exported PNG. And it's not just confined to exporting via script. I've tested 'Export for Screens', 'Export As', and 'Export for Web (Legacy)', the problem occures in all those places too.
This is quite easy to confirm for yourself; just make a file with two assets on a layer in different locations, and hide one of them, then export as a PNG by any of the above methods, or script. Compare the restult to what you get in Illustrator 2019 (2019 gives the correct result). See?
-
Mark Nicoll commented
Here are some theads reporting this same issue with PNG exporting for you to vote for:
-
MDN commented
Ok, I've been trying to upload the JSX file but won't go. So here's the code - make it yourself, then run it on the attached ai file :)
#target Illustrator
main();
function main() {
var doc = app.activeDocument;
var clipping = false;
var filePath = doc.path + "/PNG Export test/" ;
var exportDir = new Folder(filePath);
if (!exportDir.exists) exportDir.create();
var fileName = app.version + " clipping = " + clipping+ ".png";
var pngExport = new ExportOptionsPNG24();
pngExport.transparency = true;
pngExport.horizontalScale = pngExport.verticalScale = 200;
pngExport.artBoardClipping = clipping;
doc.exportFile (File( filePath + fileName ), ExportType.PNG24, pngExport );
} -
MDN commented
I've attached the files necessary to replicate this bug. I recommend testing it in 23.1 to confirm the expected behaviour, and then in 24.3 / 25.0 to see the problem.
The ai file (attached) contains two groups on the same layer. One of them is hidden.
The script sets artBoardClipping to false, but you can edit the script to set it to true to confirm that behaviour.Steps to reproduce:
Run the script <png Export test.jsx> on <png export test.ai> in both Illustrator 23.1.0 and 24.3/25.0Expected behaviour: As found in 23.1.0: the PNG exported by the script is trimmed to the visible bounds of the visible asset, and does not include the hidden item. This is correct.
Actual behaviour: In 25.0/24.3 the PNG exported by the script is too large; its bounds include the hidden item. This is problematic.
Impact: we rely on a script for exporting multiple png assets from complex compositions, without backgrounds, trimmed to the asset's visible bounds; it does this by hiding everything else and showing only the item for export, for hundreds of items in turn. This bug breaks this functionality. We can’t update Illustrator past version 23.1 until it’s fixed.
-
MDN commented
AI 24.1.1
Windows 10 1909Scripts we've always used to export PNGs for use in other projects don't work in AI 2020. They still work fine in "Legacy CC" versions (eg 2018 22.1).
When we run the script, all the PNGs come out clipped to the artboard rather than to the item bounds.
There seem to be a lot of bugs with exporting in this release - we don't know if its related to a general issue, or specifically has to do with scripting. Do we need to update the script in line with changes to the Extendscript standards (info?), or will this be fixed with an update?