Hello,
in the joigned PSDcorporate_exemple_004b.zip (10,0 Mo)
they are LayerGroups
when I try to export these groups to png images
with the command layerGroup.Save(name, pngOptions);
the group at bottom right sends an exception: Image saving failed.
my software: C# Aspose.PSD version 23.7.0
Can you tell me if it’s an Aspose problem, or I need to set some extra parameters to get image?
Best Regards
Philippe
@tecsoft could you please provide additional information.
- Additional Exception Message
- Code snippet to reproduce this
- What’s OS do you use?
- What’s version of .Net is used?
I tried to reproduce this with the following code snippet on Windows 10 x64, .Net 6:
var input = @“corporate_exemple_004b.psd”;
var baseName = @“corporate_exemple_004b”;
using (PsdImage image = (PsdImage)Image.Load(input, new PsdLoadOptions() { LoadEffectsResource = true }))
{
foreach (var layer in image.Layers)
{
if (layer is LayerGroup)
{
var name = $"{baseName}{layer.DisplayName.Replace(':', '_')}.png";
layer.Save(name, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
}
}
Many thanks for your tests.
I have made a little program just with your code: it works well too
Do not know why it’s not working in my code with exactly the same lines…
I’ll start the working program from my code, and I think it will work.
We can close this case
again many thanks.
Philippe
@tecsoft please check the following article Installation|Documentation In the Group Layer you are pointed, was a Text Layer, if you use .net standard and more fresh version of library you need to add packages System.Drawing.Common and System.Text.Encoding.CodePages packages. Hope it will be fixed in 23.9 when the .Net 7 version will be released.
Thanks for your advices
you are right, the software is working well on my development PC
not on production server
an assembly is perhaps missing
I have added System.Drawing.Common and System.Text.Encoding.CodePages dll, but no luck
still exception:
aspose.jpg (434,4 Ko)
with all these assemblies put in app directory (it’s working well on my PC)
Aspose1.jpg (278,1 Ko)
I tried .net Framework 4.8 and .Net 7.0:
- it is working on my PC (windows11 Pro)
- it is working on a Windows Server 2022
- it’s not working on a Windows Server 2016 (with .net 4.8 Framework installed and .NET 7.0 installed)
@tecsoft do you use the same file that was provided previously? This bug reproduces only in the code of published app, but not in the test projects? Do you have any concurrent processing on the prod environment?
I use the same directory (release directory of app), with the PSD file I have sent you:
on my PC with Windows 11 pro or on a Windows Server 2022: OK no problem
on two Windows Server 2016: not OK, exception got
“Do you have any concurrent processing on the prod”:
–> yes: IIS, and some background processes, but If I stop all: same exception
@tecsoft
We will make investigation using described environment. 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): PSDNET-1697: Exception on the export of Group Layer under Windows 2016 server
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.
many thanks to have found the problem
there is no emergency at my side: for this task I’ll explain my clients that they need a Windows 2022 Server.
Regards