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
8 changes: 8 additions & 0 deletions CI/job_templates/test_drawing_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
buildType: 'current'
artifactName: 'IronDrawingDataTests'
targetPath: '$(Agent.BuildDirectory)/Data'
- ${{ if or(eq(parameters.OSPlatform, 'Ubuntu'), eq(parameters.OSPlatform, 'Linux')) }}:
- task: Bash@3
displayName: 'Install GDI+ dependencies'
inputs:
targetType: 'inline'
script: |
sudo apt-get update
sudo apt-get install -y libgdiplus libc6-dev
- ${{ if eq(parameters.framework, 'netcoreapp3.1') }}:
- task: UseDotNet@2
displayName: 'Install .Netcoreapp3.1 Core sdk'
Expand Down
18 changes: 18 additions & 0 deletions IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,21 @@ private static SKBitmap OpenTiffToSKBitmap(AnyBitmap anyBitmap)
}
}

/// <summary>
/// Disable warning message written to console by BitMiracle.LibTiff.NET.
/// </summary>
private class DisableErrorHandler : TiffErrorHandler
{
public override void WarningHandler(Tiff tif, string method, string format, params object[] args)
{
// do nothing, ie, do not write warnings to console
}
public override void WarningHandlerExt(Tiff tif, object clientData, string method, string format, params object[] args)
{
// do nothing ie, do not write warnings to console
}
}

private void OpenTiffToImageSharp(ReadOnlySpan<byte> bytes)
{
try
Expand All @@ -2246,6 +2261,9 @@ private void OpenTiffToImageSharp(ReadOnlySpan<byte> bytes)
// create a memory stream out of them
using MemoryStream tiffStream = new(bytes.ToArray());

// Disable warning messages
Tiff.SetErrorHandler(new DisableErrorHandler());

// open a TIFF stored in the stream
using (Tiff tiff = Tiff.ClientOpen("in-memory", "r", tiffStream, new TiffStream()))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyOriginatorKeyFile>IronSoftware.Drawing.Common.snk</AssemblyOriginatorKeyFile>
Expand All @@ -25,7 +25,7 @@
<PackageReference Include="BitMiracle.LibTiff.NET" Version="2.4.649" />
<PackageReference Include="Microsoft.Maui.Graphics" Version="7.0.92" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="IronSoftware.Drawing.Abstractions" Version="2025.2.6" />
<PackageReference Include="IronSoftware.Drawing.Abstractions" Version="2025.4.2" />
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Memory" Version="4.5.5" />
Expand Down
8 changes: 4 additions & 4 deletions NuGet/IronSoftware.Drawing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ Supports:

For general support and technical inquiries, please email us at: support@ironsoftware.com</description>
<summary>IronSoftware.System.Drawing is an open-source solution for .NET developers to replace System.Drawing.Common with a universal and flexible library.</summary>
<releaseNotes>- Fixes incorrect HorizontalResolution and VerticalResolution of AnyBitmap images.
- Improves library's internal functionality and performance.</releaseNotes>
<releaseNotes>- Updates internal dependencies.
- Disable warning messages from BitMiracle.LibTiff.NET.</releaseNotes>
<copyright>Copyright © Iron Software 2022-2025</copyright>
<tags>Images, Bitmap, SkiaSharp, SixLabors, BitMiracle, Maui, SVG, TIFF, TIF, GIF, JPEG, PNG, Color, Rectangle, Drawing, C#, VB.NET, ASPX, create, render, generate, standard, netstandard2.0, core, netcore</tags>
<repository type="git" url="https://github.com/iron-software/IronSoftware.Drawing.Common" commit="$commit$" />
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="IronSoftware.Drawing.Abstractions" version="2025.2.6" />
<dependency id="IronSoftware.Drawing.Abstractions" version="2025.4.2" />
<dependency id="SixLabors.ImageSharp" version="2.1.10" />
<dependency id="SixLabors.ImageSharp.Drawing" version="1.0.0" />
<dependency id="BitMiracle.LibTiff.NET" version="2.4.649" />
<dependency id="System.Memory" version="4.5.5" />
</group>
<group targetFramework="net60">
<dependency id="IronSoftware.Drawing.Abstractions" version="2025.2.6" />
<dependency id="IronSoftware.Drawing.Abstractions" version="2025.4.2" />
<dependency id="SixLabors.ImageSharp" version="3.1.7" />
<dependency id="SixLabors.ImageSharp.Drawing" version="2.1.5" />
<dependency id="BitMiracle.LibTiff.NET" version="2.4.649" />
Expand Down