AWSFileUploaderWithImageCompression 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package AWSFileUploaderWithImageCompression --version 1.0.9                
NuGet\Install-Package AWSFileUploaderWithImageCompression -Version 1.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AWSFileUploaderWithImageCompression" Version="1.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AWSFileUploaderWithImageCompression --version 1.0.9                
#r "nuget: AWSFileUploaderWithImageCompression, 1.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AWSFileUploaderWithImageCompression as a Cake Addin
#addin nuget:?package=AWSFileUploaderWithImageCompression&version=1.0.9

// Install AWSFileUploaderWithImageCompression as a Cake Tool
#tool nuget:?package=AWSFileUploaderWithImageCompression&version=1.0.9                

Build Status LinkedIn

AWSFileUploaderWithImageCompression

A library for compressing, adding watermark and uploading the file into aws s3.

This library uses Magic.NET for compressing and adding watermark to the image.

Features

  • Compress the image in a simplied way.
  • Seperation of logic for uploader, compression and adding watermark.
  • Save s3 bucket space by compressing the image before uploading it.

Installation

Usage

⚙️Using the image service class
  //Initialize the s3imageuploader with respective access_key, secret_key and the bucketname
  IS3ImageUploader s3ImageUploader = new S3ImageUploader("ACCESS_KEY", "SECRET_KEY", RegionEndpoint.APSouth1, "BUCKET_NAME");
  IImageService imageService = new ImageService(s3ImageUploader);
  PutObjectResponse objectResponse =  await imageService.CompressAndUploadImageAsync(System.IO.File.OpenRead("C:/myfolder/mypic.jpg"), "newname.jpg" /* Optional to provide a new filename by default it uses Guid for the uploaded filename.*/); 
⚙️Using the individual classes
ImgCompressorConfiguration imgCompressorConfiguration = new ImgCompressorConfiguration
{
    MaintainAspectRatio = true,
    MaxHeight = 600, //Default is 1200
    MaxWidth = 800, //Default is 1600
    WaterMarkPosition = ImageMagick.Gravity.Northeast, //Default is Southeast (bottom right)
    WaterMarkTransperency = 5 //The watermark transperency ranges from 0 to 10, 0 as 0% and 10 as 100% transperency.
};
IImageCompressor compressor = new ImageCompressor(imgCompressorConfiguration /* Optional */);
//For adding watermark to the image
bool watermarkSucess = await compressor.AddWaterMark("C:/myfolder/mypic.jpg", "C:/myfolder/icons/watermark.png",
    "C:/myfolder/output/myimage.jpg");

//For compressing the image (Note: The compression will happen when the source image exceeds the MaxHeight or MaxWidth configuration.
ImageCompressorResponse compressionSuccess = await compressor.CompressImage("C:/myfolder/mypic.jpg", "C:/myfolder/output/myimage.jpg");
/* The response will have the following data :
 * 1. ImageCompressionSucccess
 * 2. OriginalSizeInBytes
 * 3. OriginalImageWidth
 * 4. OriginalImageHeight
 * 5. AfterCompressionSizeInBytes
 * 6. ResizedImageHeight
 * 7. ResizedImageWidth
 * 8. OutputFilePath
 * 9. OutPutFileStream (If output was provided as a stream)
 */

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Feel free to request for any changes or any additional features.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Name: Muthukumar Thevar

Email: mak.thevar@outlook.com

Project Link: https://github.com/mak-thevar/AWSFileUploaderWithImageCompression

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 759 6/6/2022
1.1.1 406 6/6/2022
1.1.0 401 6/6/2022
1.0.9 425 6/6/2022
1.0.8 419 6/6/2022
1.0.7 414 6/4/2022
1.0.6 431 5/24/2022
1.0.5 427 5/18/2022
1.0.4 422 5/18/2022
1.0.3 413 5/18/2022
1.0.2 428 5/18/2022