mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Some refactor for Texture2DExtensions
This commit is contained in:
@@ -275,11 +275,14 @@ namespace CubismLive2DExtractor
|
||||
return;
|
||||
}
|
||||
|
||||
using (var image = texture2D.ConvertToImage(flip: true))
|
||||
if (texture2D.TryConvertToImage(flip: true, out var image))
|
||||
{
|
||||
using (var file = File.OpenWrite(savePath))
|
||||
{
|
||||
image.WriteToStream(file, ImageFormat.Png);
|
||||
using (image)
|
||||
{
|
||||
image.WriteToStream(file, ImageFormat.Png);
|
||||
}
|
||||
}
|
||||
textureBag.Add($"textures/{texture2D.m_Name}.png");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user