Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@

public class GithubIssuesTests
{
[Fact]
public void Issue1016()
{
// Doc has letters with Shading pattern color

var path = IntegrationHelpers.GetSpecificTestDocumentPath("colorcomparecrash.pdf");

using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true }))
{
var page = document.GetPage(1);

var letters = page.Letters;

var firstLetter = letters[0];
Assert.NotNull(firstLetter.Color);

var secondLetter = letters[1];
Assert.NotNull(secondLetter.Color);

Assert.True(firstLetter.Color.Equals(secondLetter.Color));
}
}

[Fact]
public void Issue953()
{
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions src/UglyToad.PdfPig/Graphics/Colors/PatternColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public bool Equals(TilingPatternColor? other)

return PatternType.Equals(other.PatternType) &&
Matrix.Equals(other.Matrix) &&
ExtGState.Equals(other.ExtGState) &&
((ExtGState is null && other.ExtGState is null) || ExtGState?.Equals(other.ExtGState) == true) &&
PaintType.Equals(other.PaintType) &&
TilingType.Equals(other.TilingType) &&
BBox.Equals(other.BBox) &&
Expand Down Expand Up @@ -225,7 +225,7 @@ public bool Equals(ShadingPatternColor? other)

return PatternType.Equals(other.PatternType) &&
Matrix.Equals(other.Matrix) &&
ExtGState.Equals(other.ExtGState) &&
((ExtGState is null && other.ExtGState is null) || ExtGState?.Equals(other.ExtGState) == true) &&
Shading.Equals(other.Shading);
}

Expand Down
Loading