mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Put all pixmap constructors in using
statements.
Cleanup extra ImageInfo as well
This commit is contained in:
parent
0a3862ff80
commit
635dd36727
@ -556,12 +556,13 @@ 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());
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), resizedBitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
return outputPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create bitmap to use for canvas drawing used to draw into bitmap
|
||||
using (var saveBitmap = new SKBitmap(width, height))//, bitmap.ColorType, bitmap.AlphaType))
|
||||
@ -609,13 +610,14 @@ 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());
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
|
@ -49,12 +49,13 @@ 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());
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void BuildThumbCollage(string[] paths, string outputPath, int width, int height)
|
||||
{
|
||||
@ -62,12 +63,13 @@ 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());
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SKBitmap BuildThumbCollageBitmap(string[] paths, int width, int height)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user