mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System.IO;
|
|
using SixLabors.ImageSharp.Formats.Tiff;
|
|
using Xunit;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Tiff
|
|
{
|
|
[Trait("Category", "Tiff")]
|
|
public class TiffEncoderHeaderTests
|
|
{
|
|
[Fact]
|
|
public void WriteHeader_WritesValidHeader()
|
|
{
|
|
MemoryStream stream = new MemoryStream();
|
|
TiffEncoderCore encoder = new TiffEncoderCore(null);
|
|
|
|
using (TiffWriter writer = new TiffWriter(stream))
|
|
{
|
|
long firstIfdMarker = encoder.WriteHeader(writer);
|
|
}
|
|
|
|
Assert.Equal(new byte[] { 0x49, 0x49, 42, 0, 0x00, 0x00, 0x00, 0x00 }, stream.ToArray());
|
|
}
|
|
|
|
[Fact]
|
|
public void WriteHeader_ReturnsFirstIfdMarker()
|
|
{
|
|
MemoryStream stream = new MemoryStream();
|
|
TiffEncoderCore encoder = new TiffEncoderCore(null);
|
|
|
|
using (TiffWriter writer = new TiffWriter(stream))
|
|
{
|
|
long firstIfdMarker = encoder.WriteHeader(writer);
|
|
Assert.Equal(4, firstIfdMarker);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|