Update text layers properties (.NET)

Hi,

when using textLayer.UpdateText() it seems that the layer properties are changed. Also it seems that the UpdateText ignores the linebreaks etc.
Is this known problem?
Code used:

using (PsdImage image = (PsdImage)PsdImage.Load(filePath))
{
PsdImage psdImage = image;
foreach (var layer in psdImage.Layers)
{
if (layer is TextLayer)
{
TextLayer textLayer = (TextLayer)layer;
textLayer.UpdateText(textLayer.Text + “test”);
}
}
psdImage.Save(filePath + “1.psd”, new PsdOptions { CompressionMethod = CompressionMethod.RLE});
}

Hi Ryszard,

Thanks for inquiring Aspose.Imaging.

I have observed the sample code shared by you and it seems fine. Can you please first try using Aspose.Imaging for .NET 17.4 on your end. If there is still an issue then please share the source, generated and desired PSD files with us. We will investigate the issue further on our end on provision of requested information.

Many Thanks,

Hi,

code I’m using is in the original message and the file is now attached.
If you execute the code you will see that the font and styles are changed in updated file.
Regards

Hi Ryszard,

I have worked with PSD file shared by you and have been able to observe the issue specified. An issue with ID IMAGINGNET-2379 has been created in our issue tracking system to further investigate and resolve the issue on our end. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

@rlaskowski.sdl,

The issues you have found earlier (filed as IMAGINGNET-2379) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Aspose Notifier.

Please try using following sample code on your end:

using (PsdImage image = (PsdImage)Image.Load("asianSymbols.psd"))
{
    foreach (Layer layer in image.Layers)
    {
        if (layer is TextLayer)
        {
            TextLayer textLayer = (TextLayer)layer;
            textLayer.UpdateText(textLayer.Text + "test");         
        }
    }

    image.Save("asianSymbolsResult.psd", new PsdOptions { CompressionMethod = CompressionMethod.RLE });
    image.Save("asianSymbolsResult.png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}

Hi,
this does not solve all the problems. See attached files - also note the big size difference between original and updated file.
Patrik
PSD.ZIP (434.1 KB)

@rlaskowski.sdl,

I have observed the images shared by you. Can you please share the sample code that you have used for the lastly attached images. Have you used the same code as I have shared?

Hi,
yes I specifically used the same code.

@rlaskowski.sdl,

I have worked with the provided sample code and new PSD file shared by you and have been able to observe the issue on my end. An issue with ID IMAGINGNET-2661 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

Hi,
I was looking into more files and found that in some cases, the files are quite corrupted after resave - see attached sample file - after you run it through code used above the picture is losing quite a lot of items.
Regards
Patrik
DeviantArtiD_ver1.3_Green.zip (150.9 KB)

@rlaskowski.sdl,

I have observed the PSD file shared. Can you please share the used sample code along with generated output that has issue so that I may log that in our issue tracking system.

Code used:
using (PsdImage image = (PsdImage)PsdImage.Load(file))
{
//PsdImage psdImage = image;
foreach (var layer in image.Layers)
{
if (layer is TextLayer)
{
TextLayer textLayer = (TextLayer)layer;
textLayer.UpdateText("_" + textLayer.Text);
}
}

                image.Save(file + "1.psd", new PsdOptions { CompressionMethod = CompressionMethod.RLE });
            }

DeviantArtiD_ver1.3_Green.psd1.zip (102.5 KB)

@rlaskowski.sdl,

I have observed your comments. Can you please share generated result so that we may further investigate to help out. Before sharing requested information with i suggest you to please try to use Aspose.Imaging latest version 17.12 on your end.

Same issue using 17.12. Result file attached
Result_DeviantArtiD_ver1.3_Green.psd1.zip (102.5 KB)

Actually I think you can close this issue - it was a mistake in the plugin I was using to view the files.

@rlaskowski.sdl,

We are glad to know that things are started working on your own. Please feel free to contact if there is any other issue.