Hello,
I’m testing PSD files with smart objects with warping but for some reason we cant get the custom warping to work. Any help would be appreciated.
To enable custom warping for smart objects in your PSD files using Aspose.PSD for .NET, you need to ensure that you are using the correct loading options that allow for warp transformations. Here’s a sample code snippet that demonstrates how to achieve this:
using System;
using System.IO;
using Aspose.PSD.FileFormats.Psd;
using Aspose.PSD.ImageLoadOptions;
using Aspose.PSD.ImageOptions;
namespace Aspose.PSD.Examples.Aspose.SmartObjects
{
public class SupportOfWarpTransformationToSmartObject
{
public static void Run()
{
// Define the paths for the source and output files
string baseDir = RunExamples.GetDataDir_PSD();
string outputDir = RunExamples.GetDataDir_Output();
// Specify the source PSD file and output file names
string sourceFile = Path.Combine(baseDir, "source.psd");
string pngWarpedExport = Path.Combine(outputDir, "warped.png");
string psdWarpedExport = Path.Combine(outputDir, "warpFile.psd");
// Set the loading options to allow warp repaint
var warpLoadOptions = new PsdLoadOptions() { AllowWarpRepaint = true };
// Load the PSD image with the specified options
using (var image = (PsdImage)Image.Load(sourceFile, warpLoadOptions))
{
// Save the warped image in PNG and PSD formats
image.Save(pngWarpedExport, new PngOptions());
image.Save(psdWarpedExport, new PsdOptions());
}
Console.WriteLine("Warp transformation executed successfully");
}
}
}
In this example, the key part is setting AllowWarpRepaint
to true
in the PsdLoadOptions
. This allows the warp transformations to be applied correctly when loading the PSD file. Make sure that your source PSD file contains the smart objects with the desired warp effects.
If you continue to experience issues, double-check the structure of your PSD file and ensure that the smart objects are set up correctly for warping.
@AmrSalama72 could you please provide the input file and source code that was used. Aspose.PSD supports most types of Warp Transformation but they are not pixel-perfect in comparison with Photoshop rendering.
Hello,
here it is, the warping. psd is the original psd file with the warping effect and the png file is for testing and the warping_output.psd is the output without the warping effect. Any help would be appreciated.
@AmrSalama72
I’ve checked the code and input file and can confirm issue. It looks like the provided PSD file has specific structures, that affects rendering and Aspose.PSD can not apply warp transformation correctly.
We have opened the following new ticket(s) with High Priority in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PSDNET-2253
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.