Put all pixmap constructors in using
statements.
Cleanup extra ImageInfo as well
This commit is contained in:
parent
0a3862ff80
commit
635dd36727
|
@ -556,10 +556,11 @@ namespace Emby.Drawing.Skia
|
|||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
SKImageInfo imageInfo = new SKImageInfo(width,height);
|
||||
var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels());
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
return outputPath;
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
return outputPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -609,9 +610,10 @@ namespace Emby.Drawing.Skia
|
|||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath));
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
SKImageInfo imageInfo = new SKImageInfo(width, height);
|
||||
var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels());
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,9 +49,10 @@ namespace Emby.Drawing.Skia
|
|||
{
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
SKImageInfo imageInfo = new SKImageInfo(width, height);
|
||||
var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels());
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,9 +63,10 @@ namespace Emby.Drawing.Skia
|
|||
{
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
SKImageInfo imageInfo = new SKImageInfo(width, height);
|
||||
var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels());
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user