![]() |
VOOZH | about |
dotnet add package magic.lambda.image --version 17.2.0
NuGet\Install-Package magic.lambda.image -Version 17.2.0
<PackageReference Include="magic.lambda.image" Version="17.2.0" />
<PackageVersion Include="magic.lambda.image" Version="17.2.0" />Directory.Packages.props
<PackageReference Include="magic.lambda.image" />Project file
paket add magic.lambda.image --version 17.2.0
#r "nuget: magic.lambda.image, 17.2.0"
#:package magic.lambda.image@17.2.0
#addin nuget:?package=magic.lambda.image&version=17.2.0Install as a Cake Addin
#tool nuget:?package=magic.lambda.image&version=17.2.0Install as a Cake Tool
The magic.lambda.image project contains image manipulation functions for Hyperlambda, allowing you to do basic manipulation of images, in addition to generating QR codes. More specifically this project contains the following slot.
All image transformation slots works similarly. They can either be given a string being the relative filename of the image you want to transform, or a stream from where to load the image. All transformation slots can also be given a [type] argument, which is how to return the image after the transformation is done. Supported types are as follows.
In addition you can provide a [dest] argument, which if specified, becomes the relative path of where to save the image after transformation has been applied. If not specified, the image will be returned as a stream to caller, otherwise the image will be saved to the specified file.
Resizing an image can be done as follows.
image.resize:/some-image.png
height:250
type:png
The above will resize the specified image to a width of 250 pixel, converting it to PNG, while keeping the aspect ratio by calculating the new height automatically. You can provide either of.
You can provide both of the above, but at least one of the above must be specified. If one of the values are ommitted, it will be calculated by keeping the aspect ratio of the image as is. The [type] argument is how to return the image after the transformation has been applied, and can be any of the supported types as specified above. Notice, the image might be stretched in one direction if you change the existing width and height ratio during the transformation.
To crop an image you specify the following arguments.
Notice, left + right must be smaller than the total width of the image, and top + bottom must be smaller than the total height of the image. All arguments are optional, allowing you to only crop an image at one side, such as for instance illustrated below.
image.crop:/modules/test/qr.png
right:50
To convert an image from for instance png to jpeg, you can use something such as follows.
image.convert:/some-image.png
type:jpeg
The above keeps the image as is, except converts it from its existing format to a jpeg image.
You can use the [image.generate-qr] slot to create a QR code. This slot returns the QR code as a MemoryStream, which
allows you to return its output directly over the HTTP response object, which again will persist the QR code
back as the response to the caller if you're in a web project of some sort using Magic. The slot takes two arguments.
Below is an example of usage
image.generate-qr:"https://docs.aista.com"
size:8
After execution, the above invocation slot will contain a MemoryStream encapsulating your underlaying QR code.
Below is an example QR code generated by the library.
Magic is 100% Open Source and you can find the primary project GitHub page here.
The source code for this repository can be found at github.com/polterguy/magic.lambda.image, and you can provide feedback, provide bug reports, etc at the same place.
The projects is copyright Thomas Hansen 2023 - 2024, and professionally maintained by AINIRO.IO.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on magic.lambda.image:
| Package | Downloads |
|---|---|
|
magic.library
Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 17.2.0 | 1,865 | 1/22/2024 |
| 17.1.7 | 414 | 1/12/2024 |
| 17.1.6 | 377 | 1/11/2024 |
| 17.1.5 | 386 | 1/5/2024 |
| 17.0.1 | 433 | 1/1/2024 |
| 17.0.0 | 604 | 12/14/2023 |
| 16.11.5 | 482 | 11/12/2023 |
| 16.9.0 | 415 | 10/9/2023 |
| 16.7.0 | 741 | 7/11/2023 |
| 16.4.1 | 598 | 7/2/2023 |
| 16.4.0 | 565 | 6/22/2023 |
| 16.3.1 | 453 | 6/7/2023 |
| 16.3.0 | 465 | 5/28/2023 |
| 16.1.9 | 768 | 4/30/2023 |
| 15.10.11 | 607 | 4/13/2023 |
| 15.9.1 | 732 | 3/27/2023 |
| 15.9.0 | 571 | 3/24/2023 |
| 15.8.2 | 624 | 3/20/2023 |
| 15.7.0 | 534 | 3/6/2023 |
| 15.5.0 | 1,813 | 1/28/2023 |