mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
This commit is contained in:
@@ -64,11 +64,25 @@ namespace ImageResizer.Models
|
||||
|
||||
foreach (var originalFrame in decoder.Frames)
|
||||
{
|
||||
BitmapMetadata metadata = (BitmapMetadata)originalFrame.Metadata;
|
||||
if (metadata != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Detect whether metadata can copied successfully
|
||||
_ = metadata.Clone();
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
metadata = null;
|
||||
}
|
||||
}
|
||||
|
||||
encoder.Frames.Add(
|
||||
BitmapFrame.Create(
|
||||
Transform(originalFrame),
|
||||
thumbnail: null,
|
||||
(BitmapMetadata)originalFrame.Metadata, // TODO: Add an option to strip any metadata that doesn't affect rendering (issue #3)
|
||||
metadata, // TODO: Add an option to strip any metadata that doesn't affect rendering (issue #3)
|
||||
colorContexts: null));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user