mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[Image Resizer]Try to recover metadata even when the metadata data structure is invalid (#14914)
* metadata.Clone() fails also for situations where we still can recover metadata metadata.Clone() is also an expensive operation (deep copy) and it is not necessary anymore as we build up the metadata object from scratch anyway * If an exception is throw here something is seriously wrong with the metadata structure We take all metadata we have read so far an write it to the resized image * add log statement * Adjust test written for #2447 as we are able to copy the metadata now * Improve documentation
This commit is contained in:
committed by
GitHub
parent
1e0033166f
commit
9152ea8f1c
@@ -33,7 +33,7 @@ namespace ImageResizer.Models
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ExecuteCopiesFrameMetadataExceptWhenMetadataCannotBeCloned()
|
||||
public void ExecuteCopiesFrameMetadataEvenWhenMetadataCannotBeCloned()
|
||||
{
|
||||
var operation = new ResizeOperation("TestMetadataIssue2447.jpg", _directory, Settings());
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace ImageResizer.Models
|
||||
|
||||
AssertEx.Image(
|
||||
_directory.File(),
|
||||
image => Assert.IsNull(((BitmapMetadata)image.Frames[0].Metadata).CameraModel));
|
||||
image => Assert.IsNotNull(((BitmapMetadata)image.Frames[0].Metadata).CameraModel));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
Reference in New Issue
Block a user