aspose-free-consulting / projects

The starting point for Aspose free consulting projects
5 stars 5 forks source link

A bug in which smart filters on the layer do not work. #351

Closed LoadingT closed 7 months ago

LoadingT commented 7 months ago
internal static async Task test()
{
    var loadOptions = new PsdLoadOptions() {};
    using (var image = Image.Load($"Documents/poland.psd", loadOptions))
    {
        if (image is PsdImage psdImage)
        {
            var TextP = psdImage.Layers.FirstOrDefault(p => p.Name == "TEXT_EDITOR");
            if (TextP != null && TextP is SmartObjectLayer smartObject)
            { 
                var img = smartObject.LoadContents(loadOptions);
                smartObject.ReplaceContents(img);
                smartObject.SmartFilters.UpdateResourceValues();
                smartObject.UpdateModifiedContent();
                var saveOptions = new PngOptions() { };
                psdImage.Save("Result.png", saveOptions);
            }
        }
        else
        {
            throw new InvalidOperationException("Документ не является PSD-файлом.");
        }
    }
}

No matter how hard I try, but it doesn't want to accept any filters on my layer with smart filters, I have a file with text layers in the layer

aspose-yaroslav-lisovskyi commented 7 months ago

@LoadingT I checked your code with my own created source file, and it works correctly for me. Maybe your source file uses smart filters that are not supported by Aspose.PSD. Currently, we support rendering for these smart filers:

Also, we support the ability to create custom smart filters, if it's interesting for you I can send a code example for it.

LoadingT commented 7 months ago

image I use standard smart filters from Photoshop, will I have to make them myself? please send me an example code that will help me do this..

I suggest that in the future you add all smart filters to the library or, if it is time-consuming, write instructions on how to create your own

also the question is, what effects are supported? I still have a shadow standing here

LoadingT commented 7 months ago

image in the first photo, the result is after Aspose.PSD image in the second in Photoshop

also, when saving via Photoshop, the file is less by 5 MB than via Aspose.PSD

aspose-yaroslav-lisovskyi commented 7 months ago

I use standard smart filters from Photoshop, will I have to make them myself? please send me an example code that will help me do this..

I suggest that in the future you add all smart filters to the library or, if it is time-consuming, write instructions on how to create your own>

Here in the 'Examples' section, you can find code that helps you create the custom smart filter. https://reference.aspose.com/psd/net/aspose.psd/pixelsdata/#examples

also the question is, what effects are supported? I still have a shadow standing here

Supported effects:

  • Drop Shadow
  • Outer Glow
  • Pattern Overlay
  • Gradient Overlay
  • Color Overlay
  • Inner Shadow
  • Stroke

Unsupported effects:

aspose-yaroslav-lisovskyi commented 7 months ago

in the first photo, the result is after Aspose.PSD in the second in Photoshop

also, when saving via Photoshop, the file is less by 5 MB than via Aspose.PSD

If you use unsupported smart filters the result can be unsatisfactory. Otherwise, provide please your source file so I can check the issue and give a more accurate response.

LoadingT commented 7 months ago

Ok , reject