An open API service indexing awesome lists of open source software.

https://github.com/verifytests/verify.imagesharp

Extends Verify to allow verification of documents via ImageSharp.
https://github.com/verifytests/verify.imagesharp

Last synced: 9 months ago
JSON representation

Extends Verify to allow verification of documents via ImageSharp.

Awesome Lists containing this project

README

          

# Verify.ImageSharp

[![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true&label=)](https://github.com/orgs/VerifyTests/discussions)
[![Build status](https://ci.appveyor.com/api/projects/status/o30f8u47l7vv5844?svg=true)](https://ci.appveyor.com/project/SimonCropp/Verify-ImageSharp)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.ImageSharp.svg)](https://www.nuget.org/packages/Verify.ImageSharp/)

Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of documents via [ImageSharp](https://github.com/SixLabors/ImageSharp).

**See [Milestones](../../milestones?state=closed) for release notes.**

## Sponsors

### Entity Framework Extensions

[Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.ImageSharp) is a major sponsor and is proud to contribute to the development this project.

[![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.ImageSharp/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.ImageSharp)

## NuGet

* https://nuget.org/packages/Verify.ImageSharp

## Usage


```cs
[ModuleInitializer]
public static void Init() =>
VerifyImageSharp.Initialize();
```
snippet source | anchor

### Verify a file


```cs
[Test]
public Task VerifyImageFile() =>
VerifyFile("sample.jpg");
```
snippet source | anchor

```cs
[Test]
public Task VerifyImageFileWithCustomEncoder() =>
VerifyFile("sample.jpg")
.EncodeAsPng();
```
snippet source | anchor

Two files are produced

#### Info file:

Samples.VerifyImageFile.verified.txt


```txt
{
Width: 1599,
Height: 1066,
HorizontalResolution: 1.0,
VerticalResolution: 1.0
}
```
snippet source | anchor

#### Image file:

Samples.VerifyImageFile.verified.jpg

### Verify an SixLabors.ImageSharp.Image

An instance if an `SixLabors.ImageSharp.Image` can be verified using the following:


```cs
[Test]
public Task VerifyImage()
{
var image = new Image(11, 11)
{
[5, 5] = Rgba32.ParseHex("#0000FF")
};
return Verify(image);
}
```
snippet source | anchor

## File Samples

http://file-examples.com/

## Icon

[Swirl](https://thenounproject.com/term/pattern/2719636/) designed by [BÖCK, RU](https://thenounproject.com/titaniclast/) from [The Noun Project](https://thenounproject.com).