vendoring NetVips

This commit is contained in:
Renjaya Raga Zenta 2025-07-31 00:17:59 +07:00
parent 36a0f8d39c
commit 33e9d5f43a
41 changed files with 21749 additions and 0 deletions

44
vendor/NetVips/VipsException.cs vendored Normal file
View file

@ -0,0 +1,44 @@
using System;
using NetVips.Internal;
namespace NetVips;
/// <summary>
/// Our own exception class which handles the libvips error buffer.
/// </summary>
public class VipsException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="VipsException"/> class.
/// </summary>
public VipsException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="VipsException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public VipsException(string message)
: base($"{message}{Environment.NewLine}{VipsErrorBuffer()}")
{
Vips.ErrorClear();
}
/// <summary>
/// Initializes a new instance of the <see cref="VipsException"/> class with a specified error message
/// and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="inner">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
public VipsException(string message, Exception inner)
: base($"{message}{Environment.NewLine}{VipsErrorBuffer()}", inner)
{
Vips.ErrorClear();
}
private static string VipsErrorBuffer()
{
return Vips.ErrorBuffer().ToUtf8String();
}
}