Skip to content

Commit 9e29af2

Browse files
Merge pull request #2946 from SixLabors/js/transform-metadata
Update Subject EXIF metadata when transforming images.
2 parents 2167475 + 27848d0 commit 9e29af2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+521
-139
lines changed

src/ImageSharp/Formats/Bmp/BmpMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.PixelFormats;
56

67
// TODO: Add color table information.
@@ -156,7 +157,7 @@ public FormatConnectingMetadata ToFormatConnectingMetadata()
156157
public BmpMetadata DeepClone() => new(this);
157158

158159
/// <inheritdoc/>
159-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
160+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
160161
where TPixel : unmanaged, IPixel<TPixel>
161162
=> this.ColorTable = null;
162163
}

src/ImageSharp/Formats/Cur/CurFrameMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.Formats.Bmp;
56
using SixLabors.ImageSharp.Formats.Icon;
67
using SixLabors.ImageSharp.PixelFormats;
@@ -117,7 +118,7 @@ public FormatConnectingFrameMetadata ToFormatConnectingFrameMetadata()
117118
};
118119

119120
/// <inheritdoc/>
120-
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
121+
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Matrix4x4 matrix)
121122
where TPixel : unmanaged, IPixel<TPixel>
122123
{
123124
float ratioX = destination.Width / (float)source.Width;

src/ImageSharp/Formats/Cur/CurMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.Formats.Bmp;
56
using SixLabors.ImageSharp.Formats.Icon;
67
using SixLabors.ImageSharp.PixelFormats;
@@ -148,7 +149,7 @@ public FormatConnectingMetadata ToFormatConnectingMetadata()
148149
};
149150

150151
/// <inheritdoc/>
151-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
152+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
152153
where TPixel : unmanaged, IPixel<TPixel>
153154
=> this.ColorTable = null;
154155

src/ImageSharp/Formats/Gif/GifFrameMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.PixelFormats;
56

67
namespace SixLabors.ImageSharp.Formats.Gif;
@@ -103,7 +104,7 @@ public FormatConnectingFrameMetadata ToFormatConnectingFrameMetadata()
103104
}
104105

105106
/// <inheritdoc/>
106-
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
107+
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Matrix4x4 matrix)
107108
where TPixel : unmanaged, IPixel<TPixel>
108109
=> this.LocalColorTable = null;
109110

src/ImageSharp/Formats/Gif/GifMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.PixelFormats;
56

67
namespace SixLabors.ImageSharp.Formats.Gif;
@@ -105,7 +106,7 @@ public FormatConnectingMetadata ToFormatConnectingMetadata()
105106
};
106107

107108
/// <inheritdoc/>
108-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
109+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
109110
where TPixel : unmanaged, IPixel<TPixel>
110111
=> this.GlobalColorTable = null;
111112

src/ImageSharp/Formats/IFormatFrameMetadata.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.PixelFormats;
56

67
namespace SixLabors.ImageSharp.Formats;
@@ -22,7 +23,8 @@ public interface IFormatFrameMetadata : IDeepCloneable
2223
/// <typeparam name="TPixel">The type of pixel format.</typeparam>
2324
/// <param name="source">The source image frame.</param>
2425
/// <param name="destination">The destination image frame.</param>
25-
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
26+
/// <param name="matrix">The transformation matrix applied to the image frame.</param>
27+
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Matrix4x4 matrix)
2628
where TPixel : unmanaged, IPixel<TPixel>;
2729
}
2830

src/ImageSharp/Formats/IFormatMetadata.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.PixelFormats;
56

67
namespace SixLabors.ImageSharp.Formats;
@@ -27,7 +28,8 @@ public interface IFormatMetadata : IDeepCloneable
2728
/// </summary>
2829
/// <typeparam name="TPixel">The type of pixel format.</typeparam>
2930
/// <param name="destination">The destination image .</param>
30-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
31+
/// <param name="matrix">The transformation matrix applied to the image.</param>
32+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
3133
where TPixel : unmanaged, IPixel<TPixel>;
3234
}
3335

src/ImageSharp/Formats/Ico/IcoFrameMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.Formats.Bmp;
56
using SixLabors.ImageSharp.Formats.Icon;
67
using SixLabors.ImageSharp.PixelFormats;
@@ -110,7 +111,7 @@ public FormatConnectingFrameMetadata ToFormatConnectingFrameMetadata()
110111
};
111112

112113
/// <inheritdoc/>
113-
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
114+
public void AfterFrameApply<TPixel>(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Matrix4x4 matrix)
114115
where TPixel : unmanaged, IPixel<TPixel>
115116
{
116117
float ratioX = destination.Width / (float)source.Width;

src/ImageSharp/Formats/Ico/IcoMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.Formats.Bmp;
56
using SixLabors.ImageSharp.Formats.Icon;
67
using SixLabors.ImageSharp.PixelFormats;
@@ -148,7 +149,7 @@ public FormatConnectingMetadata ToFormatConnectingMetadata()
148149
};
149150

150151
/// <inheritdoc/>
151-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
152+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
152153
where TPixel : unmanaged, IPixel<TPixel>
153154
=> this.ColorTable = null;
154155

src/ImageSharp/Formats/Jpeg/JpegMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Numerics;
45
using SixLabors.ImageSharp.Formats.Jpeg.Components;
56
using SixLabors.ImageSharp.PixelFormats;
67

@@ -200,7 +201,7 @@ public FormatConnectingMetadata ToFormatConnectingMetadata()
200201
};
201202

202203
/// <inheritdoc/>
203-
public void AfterImageApply<TPixel>(Image<TPixel> destination)
204+
public void AfterImageApply<TPixel>(Image<TPixel> destination, Matrix4x4 matrix)
204205
where TPixel : unmanaged, IPixel<TPixel>
205206
{
206207
}

0 commit comments

Comments
 (0)