Hello,
We’ve recently upgraded our software from .NET 6 to .NET 8, and as part of that transition, we also purchased a new license for Aspose.Diagram and upgraded from version 21.2.0 to 25.7.0.
After the upgrade, we’re encountering an issue when reusing VSSX stencils across our application. Specifically, we use two stencils with identical masters, one using PNGs and the other using SVGs. However, this issue also occurs when a single stencil contains a mix of PNGs and SVG, in such cases, only the SVG-based masters render correctly, while the PNGs become corrupted.
In version 25.7.0 (haven’t tested previous versions), we’ve observed that reusing or saving a stencil multiple times causes PNG-based masters to become corrupted. The PNG masters are replaced with a black square with diagonal lines, whereas SVG masters work fine. This issue did not occur in version 21.2.0.
// Version 21.2.0 & 25.7.0
new License().SetLicense("license.lic");
const string stencilPath = "stencil.vssx";
const string outputGoodPath = "output_good.vsdx";
const string outputBadPath = "output_bad.vsdx";
const double width = 0.5;
const double height = 0.5;
// Masters that exist in the stencil.vssx
const string pngMasterName = "CactusPng";
const string svgMasterName = "CactusSvg";
var stencil = new Diagram.Diagram(stencilPath);
var pngMaster = stencil.Masters.GetMasterByName(pngMasterName);
var svgMaster = stencil.Masters.GetMasterByName(svgMasterName);
stencil.Pages.Clear();
stencil.Pages.Add(new Page { Name = "Page 1" });
var page = stencil.Pages[0];
var centerX = page.PageSheet.PageProps.PageWidth.Value / 2.0;
var centerY = page.PageSheet.PageProps.PageHeight.Value / 2.0;
page.AddShape(centerX + width / 2, centerY + height / 2, width, height, pngMaster.Name);
page.AddShape(centerX - width / 2, centerY + height / 2, width, height, svgMaster.Name);
// Here, .Save will work, no issue
stencil.Save(outputGoodPath, SaveFileFormat.Vsdx);
// Here, all masters of type PNG become corrupted/black box as opposed to SVG working fine
stencil.Save(outputBadPath, SaveFileFormat.Vsdx);
To help reproduce the issue, I’ve attached:
- A code snippet that demonstrates the problem.
- A VSSX stencil file containing both PNG and SVG-based masters. (I cannot attach the file to the topic, therefore I uploaded it to Google Drive)
- Screenshots showing the rendering issue.
eYd3ETts7P.png (7.7 KB)
dGYyDTITEq.png (9.3 KB)
Please let me know:
- If this is a known or expected change in behavior.
- If there are any recommended workarounds or fixes.
- If you need any additional information from our side.
Thanks in advance for your support!
@pslcali87
It sounds like you’re experiencing a regression issue with PNG-based masters in your VSSX stencils after upgrading to Aspose.Diagram version 25.7.0. This is concerning, especially since it worked fine in version 21.2.0.
Cause: The issue may stem from changes in image handling or stencils in the new version.
Solution: Here are some steps you can take to diagnose and potentially resolve the issue:
-
Check for Known Issues: Review the release notes for version 25.7.0 to see if there are any documented changes or known issues related to image handling or stencils. This can provide insight into whether this behavior is expected.
-
Test with Different Versions: Test your code with an earlier version of Aspose.Diagram (like 21.2.0) to confirm that the issue is specific to the new version. This will help in reporting the issue to Aspose support.
-
Isolate the Problem: Create a minimal example that reproduces the issue. This can help in identifying if the problem lies within your specific implementation or if it’s a broader issue with the library.
-
Contact Support: If the issue persists, reach out to Aspose support with your findings. Provide them with the code snippet, the stencil file, and any other relevant information. This will help them investigate the problem more effectively.
-
Workaround: As a temporary measure, avoid reusing the PNG masters in the same way until a fix is provided. You could also explore converting PNGs to another format or using different stencils if feasible.
Next Steps: Please follow the steps outlined above and let me know if you need further assistance or if you have any updates on the situation. I am here to help!
@pslcali87
Thanks for the template file and screenshots.
After an initial testing, I am able to reproduce the issue as you mentioned by using your template file.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): DIAGRAMNET-53793
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as DIAGRAMNET-53793) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou
Hello,
Thank you very much for the quick turnaround and releasing a new version with the fix! I really appreciate the effort.
However, while the fix resolves the issue for the code snippet I originally shared, it unfortunately seems to have introduced a new problem with our internal stencil containing PNG masters. Previously, the first use and save of the stencil would work fine, though re-using
stencil.zip (2.4 MB)
it would eventually break the PNG masters, displaying a black square with diagonal lines. Now, with the latest version, the PNG masters are broken immediately upon saving our .VSSX stencil as .VSDX.
Could you please help clarify what might be causing this issue? Is there something specific about our stencil setup that could be problematic?
For your reference, I’ve attached our stencil file with PNGs and included a minimal code snippet that reproduces the problem:
// Worked on Version 21.2.0, but breaks on 25.8.0
new License().SetLicense("license.lic");
const string stencilPath = "Stencil-Example.vssx";
const string stencilOutput = "Stencil-Output.vssx";
var stencil = new Diagram.Diagram(stencilPath);
stencil.Save(stencilOutput, SaveFileFormat.Vssx);
Thank you for your help!
Best regards,
@pslcali87
Thanks for the template file.
We reproduced the problems you mentioned by converting your template VSSX file to VSSX.
We apologize for any inconvenience caused.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): DIAGRAMNET-53796
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as DIAGRAMNET-53796) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou