-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/imazen/imageflow-dotnet
- Loading branch information
Showing
35 changed files
with
2,349 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (console)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>", | ||
"args": [], | ||
"cwd": "${workspaceRoot}", | ||
"stopAtEntry": false, | ||
"externalConsole": false | ||
}, | ||
{ | ||
"name": ".NET Core Launch (web)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>", | ||
"args": [], | ||
"cwd": "${workspaceRoot}", | ||
"stopAtEntry": false, | ||
"launchBrowser": { | ||
"enabled": true, | ||
"args": "${auto-detect-url}", | ||
"windows": { | ||
"command": "cmd.exe", | ||
"args": "/C start ${auto-detect-url}" | ||
}, | ||
"osx": { | ||
"command": "open" | ||
}, | ||
"linux": { | ||
"command": "xdg-open" | ||
} | ||
}, | ||
"env": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"sourceFileMap": { | ||
"/Views": "${workspaceRoot}/Views" | ||
} | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command.pickProcess}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (console)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>", | ||
"args": [], | ||
"cwd": "${workspaceRoot}", | ||
"externalConsole": false, | ||
"stopAtEntry": false, | ||
"internalConsoleOptions": "openOnSessionStart" | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command.pickProcess}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "0.1.0", | ||
"command": "dotnet", | ||
"isShellCommand": true, | ||
"args": [], | ||
"tasks": [ | ||
{ | ||
"taskName": "build", | ||
"args": [ | ||
"" | ||
], | ||
"isBuildCommand": true, | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
contrib/contrib_bindings/Imageflow/BufferOverflowException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
|
||
namespace Imageflow | ||
{ | ||
/// <summary> | ||
/// The exception that is thrown when a native buffer is too large to be marshaled into a managed byte array. | ||
/// </summary> | ||
/// <seealso cref="Exception" /> | ||
public class BufferOverflowException : Exception | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BufferOverflowException"/> class. | ||
/// </summary> | ||
/// <param name="bufferSize">Size of the buffer.</param> | ||
public BufferOverflowException(long bufferSize) | ||
{ | ||
BufferSize = bufferSize; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BufferOverflowException"/> class. | ||
/// </summary> | ||
/// <param name="message">The message.</param> | ||
/// <param name="bufferSize">Size of the buffer.</param> | ||
public BufferOverflowException(string message, long bufferSize) : base(message) | ||
{ | ||
BufferSize = bufferSize; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BufferOverflowException"/> class. | ||
/// </summary> | ||
/// <param name="message">The message.</param> | ||
/// <param name="bufferSize">Size of the buffer.</param> | ||
/// <param name="innerException">The inner exception.</param> | ||
public BufferOverflowException(string message, long bufferSize, Exception innerException) : base(message, innerException) | ||
{ | ||
BufferSize = bufferSize; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the size of the buffer. | ||
/// </summary> | ||
/// <value> | ||
/// The size of the buffer. | ||
/// </value> | ||
public long BufferSize | ||
{ | ||
get; | ||
} | ||
|
||
/// <summary> | ||
/// Gets a message that describes the current exception. | ||
/// </summary> | ||
public override string Message => $"The native buffer was too large to be marshaled into a managed byte array. Native Buffer Size: {BufferSize}."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace Imageflow | ||
{ | ||
/// <summary> | ||
/// Common Exceptions | ||
/// </summary> | ||
internal static class Exceptions | ||
{ | ||
/// <summary> | ||
/// Parameter is not the correct. | ||
/// </summary> | ||
/// <typeparam name="TWantedType">The type of the wanted type.</typeparam> | ||
/// <param name="nameOfParameter">The name of parameter.</param> | ||
/// <returns>An <see cref="ArgumentException"/> with filled in message and parameter.</returns> | ||
public static ArgumentException ParameterIsNotTheCorrectType<TWantedType>(string nameOfParameter) => new ArgumentException($"{nameOfParameter} is not an {typeof(TWantedType).Name}."); | ||
|
||
/// <summary> | ||
/// No value for JSON property. | ||
/// </summary> | ||
/// <param name="propertyName">Name of the property.</param> | ||
/// <returns>A <see cref="JsonException"/> with filled message.</returns> | ||
public static JsonException NoValue(string propertyName) => new JsonException($"No value for property {propertyName}."); | ||
} | ||
} | ||
#pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
| ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Style", "CC0105:You should use 'var' whenever possible.", Justification = "var is only useful with IDEs")] | ||
[assembly: SuppressMessage("Style", "CC0001:You should use 'var' whenever possible.", Justification = "var is only useful with IDEs")] | ||
[assembly: SuppressMessage("Language Usage Opportunities", "RECS0091:Use 'var' keyword when possible", Justification = "var is only useful with IDEs")] | ||
[assembly: SuppressMessage("Style", "RECS0129: C# modifier is redundant", Justification = "Modifiers should always be explicitly stated")] | ||
[assembly: SuppressMessage("Style", "RECS0145: C# 'private' modifier is redundant", Justification = "Modifiers should always be explicitly stated")] | ||
[assembly: SuppressMessage("Maintainability", "S1309:Track uses of in-source issue suppressions", Justification = "Redunent")] | ||
[assembly: SuppressMessage("General", "RCS1024:Format accessor list.", Justification = "LINES")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Description>Imageflow brings world-class image quality and performance to all languages through a C-compatible API (libimageflow) and a separate RESTful turnkey HTTP server and command-line tool. Linux, Mac, and Windows are supported.</Description> | ||
<Copyright>Copyright 2016 Imazen</Copyright> | ||
<AssemblyTitle>Imageflow</AssemblyTitle> | ||
<Authors>Imazen</Authors> | ||
<TargetFramework>netstandard1.3</TargetFramework> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<AssemblyName>Imageflow</AssemblyName> | ||
<PackageId>Imageflow</PackageId> | ||
<PackageTags>Imazen;Imageflow</PackageTags> | ||
<PackageIconUrl>https://www.imageflow.io/images/imageflow-icon.png</PackageIconUrl> | ||
<PackageLicenseUrl>https://github.com/imazen/imageflow/blob/master/LICENSE</PackageLicenseUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https://github.com/imazen/imageflow</RepositoryUrl> | ||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | ||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | ||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="EWSoftware.SHFB" Version="2017.5.15"> | ||
<PrivateAssets>All</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="EWSoftware.SHFB.NETCore" Version="4.5.1"> | ||
<PrivateAssets>All</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> | ||
<PackageReference Include="System.Diagnostics.Tools" Version="4.3.0"> | ||
<IncludeAssets>Compile</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" /> | ||
<PackageReference Include="System.IO.UnmanagedMemoryStream" Version="4.3.0" /> | ||
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" /> | ||
<PackageReference Include="System.Threading" Version="4.3.0" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.