Free Support Forum - aspose.com

Leaking resources


#1

Hi,
I wanted to convert psd to jpg format. Seem likes no problem with the conversion. But the result file is not good (empty jpg file). In addition, I used the while loop and checked Tack Manager, realized that resource is not released. See my code

static int psd2jpg(string inFile, string outFile)
{
try
{
using(FileStream fStream = new FileStream(inFile, FileMode.Open, FileAccess.ReadWrite,
FileShare.ReadWrite))
{
var psd = Aspose.PSD.Image.Load(fStream);
psd.Save(outFile, new Aspose.PSD.ImageOptions.JpegOptions()
{
Quality = 100
});
}
return 0;
}
catch
{
return 1;
}
}

static void Main(string[] args)
{
Aspose.PSD.License lic = new Aspose.PSD.License();
lic.SetLicense(“Aspose.Total.lic”);
int ret = psd2jpg(@“D:\in.psd”, @“D:\out.jpg”);
System.Console.WriteLine(ret);
while(true) { }
}

My input file: https://drive.google.com/file/d/1MJIrkdh-grQLfRRS7F92e1AyG5Uny9Uv/view


#2

@dunghnguyen,

I have worked with source files and have been able to observe issue. A ticket with ID PSDNET-119 has been created in our issue tracking system for further investigate and resolve. This thread has been associated with this ticket, so that you can be automatically notified as soon as this issue is resolved.