Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Dec 3, 2019

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This PR adds the following method:

IImageInfo Image.Identify(stream, out IImageFormat format);

Which mirrors the Image.Load method. I spotted a need for it when writing a PR for PeachPie.

It also fixes the issue identified here. Where it was possible to misidentify an image as TGA.

#1026 (comment)

@codecov
Copy link

codecov bot commented Dec 3, 2019

Codecov Report

Merging #1059 into master will increase coverage by 0.02%.
The diff coverage is 87.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1059      +/-   ##
==========================================
+ Coverage   89.91%   89.94%   +0.02%     
==========================================
  Files        1131     1131              
  Lines       50605    50619      +14     
  Branches     3713     3715       +2     
==========================================
+ Hits        45502    45528      +26     
+ Misses       4347     4335      -12     
  Partials      756      756
Impacted Files Coverage Δ
...c/ImageSharp/Formats/Tga/TgaImageFormatDetector.cs 75% <0%> (ø) ⬆️
src/ImageSharp/Image.FromStream.cs 89.58% <100%> (+14.02%) ⬆️
...sts/ImageSharp.Tests/Formats/GeneralFormatTests.cs 100% <100%> (+1.28%) ⬆️
...c/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs 66.66% <50%> (-33.34%) ⬇️
src/ImageSharp/Image.Decode.cs 96.77% <90%> (+7.48%) ⬆️
...c/ImageSharp/Formats/Tga/TgaImageTypeExtensions.cs 80% <0%> (-20%) ⬇️
src/ImageSharp/Formats/Tga/TgaDecoderCore.cs 88.1% <0%> (+1.76%) ⬆️
src/ImageSharp/Formats/Tga/TgaDecoder.cs 100% <0%> (+40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0322ee2...8762bde. Read the comment docs.

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@JimBobSquarePants JimBobSquarePants merged commit 1017121 into master Dec 4, 2019
@JimBobSquarePants JimBobSquarePants deleted the js/format-with-identify branch December 4, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants