Skip to content

Commit 136cc14

Browse files
Merge pull request #2066 from SixLabors/js/exif-thumbnail
Add non-generic overload for ExifProfile.CreateThumbnail<TPixel>().
2 parents 2bedf20 + d4acfce commit 136cc14

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/ImageSharp/Metadata/Profiles/Exif/ExifProfile.cs

+8
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ public IReadOnlyList<IExifValue> Values
121121
}
122122
}
123123

124+
/// <summary>
125+
/// Returns the thumbnail in the EXIF profile when available.
126+
/// </summary>
127+
/// <returns>
128+
/// The <see cref="Image"/>.
129+
/// </returns>
130+
public Image CreateThumbnail() => this.CreateThumbnail<Rgba32>();
131+
124132
/// <summary>
125133
/// Returns the thumbnail in the EXIF profile when available.
126134
/// </summary>

tests/ImageSharp.Tests/Metadata/Profiles/Exif/ExifProfileTests.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,15 @@ public void Values()
354354

355355
TestProfile(profile);
356356

357-
using Image<Rgba32> thumbnail = profile.CreateThumbnail<Rgba32>();
357+
using Image thumbnail = profile.CreateThumbnail();
358358
Assert.NotNull(thumbnail);
359359
Assert.Equal(256, thumbnail.Width);
360360
Assert.Equal(170, thumbnail.Height);
361+
362+
using Image<Rgba32> genericThumbnail = profile.CreateThumbnail<Rgba32>();
363+
Assert.NotNull(genericThumbnail);
364+
Assert.Equal(256, genericThumbnail.Width);
365+
Assert.Equal(170, genericThumbnail.Height);
361366
}
362367

363368
[Fact]

0 commit comments

Comments
 (0)