mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(ImageFormat.Write): use overloaded BitmapFrame.Create method.
incorrect metadata sometimes causes ArgumentException.
This commit is contained in:
parent
92ad52ca43
commit
02efade7ff
@ -72,7 +72,7 @@ namespace GameRes
|
|||||||
public override void Write (Stream file, ImageData image)
|
public override void Write (Stream file, ImageData image)
|
||||||
{
|
{
|
||||||
var encoder = new BmpBitmapEncoder();
|
var encoder = new BmpBitmapEncoder();
|
||||||
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap));
|
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap, null, null, null));
|
||||||
encoder.Save (file);
|
encoder.Save (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ namespace GameRes
|
|||||||
{
|
{
|
||||||
var encoder = new JpegBitmapEncoder();
|
var encoder = new JpegBitmapEncoder();
|
||||||
encoder.QualityLevel = Quality;
|
encoder.QualityLevel = Quality;
|
||||||
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap));
|
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap, null, null, null));
|
||||||
encoder.Save (file);
|
encoder.Save (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ namespace GameRes
|
|||||||
public override void Write (Stream file, ImageData image)
|
public override void Write (Stream file, ImageData image)
|
||||||
{
|
{
|
||||||
var encoder = new PngBitmapEncoder();
|
var encoder = new PngBitmapEncoder();
|
||||||
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap));
|
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap, null, null, null));
|
||||||
if (0 == image.OffsetX && 0 == image.OffsetY)
|
if (0 == image.OffsetX && 0 == image.OffsetY)
|
||||||
{
|
{
|
||||||
encoder.Save (file);
|
encoder.Save (file);
|
||||||
|
@ -58,7 +58,7 @@ namespace GameRes
|
|||||||
{
|
{
|
||||||
var encoder = new TiffBitmapEncoder();
|
var encoder = new TiffBitmapEncoder();
|
||||||
encoder.Compression = TiffCompressOption.Zip;
|
encoder.Compression = TiffCompressOption.Zip;
|
||||||
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap));
|
encoder.Frames.Add (BitmapFrame.Create (image.Bitmap, null, null, null));
|
||||||
encoder.Save (file);
|
encoder.Save (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user