Code Monkey home page Code Monkey logo

imagewizard's People

Contributors

dependabot[bot] avatar usercode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

imagewizard's Issues

Suggestion for signature

Hi @usercode,

Can we allow to sign only 2 parts of the url?

Example:

We just sign "loader type" and "loader source" make the "filters" part free to use.

When signing url via api:

  • Add option to sign 2 parts
  • Add a dot (".") to any place of the signature

When validating:

  • Just check the dot (".") to do the validation.
  • We can also apply rate limit for the new one (Example: user can make up to 1000 different filters per day)

This may affect the cache strategy.

Thanks,

Duong

UseUnsafeUrl remove 'unsafe' from url?

Firstly a great library, well done.

  1. I was wondering when using the UseUnsafeUrl set to true, is there a way for the unsafe word to be removed from the url?
    https://localhsot:5001/image/unsafe/.... to https://localhsot:5001/image/.... ?

ImageWizard.Azure does not work

Hi,
i have tested the untested "ImageWizard.Azure" package and it does net work :)

Setup:

services.AddImageWizard(x =>
{
x.AllowUnsafeUrl = true;
//x.Key = "DEMO-KEY---PLEASE-CHANGE-THIS-KEY---PLEASE-CHANGE-THIS-KEY---PLEASE-CHANGE-THIS-KEY---==";
})
.AddHttpLoader(x=>
{
//x.RefreshMode = ImageLoaderRefreshMode.EveryTime;
x.SetHeader("Api", "XYZ");
})
.AddFileLoader()
.AddYoutubeLoader()
.AddGravatarLoader()
.AddAnalytics()
.AddAzureBlob(x =>
{
x.ConnectionString = "UseDevelopmentStorage=true";
x.ContainerName = "test";
});

and URL:
https://localhost:32768/image/unsafe/resize(500,500)/grayscale()/jpg(100)/azure/test.png

and result(in the browser): "image loader not found: azure"

it seems that imageLoader (see below) is alwas null .

Type imageLoaderType = ImageLoaderManager.Get(url_loaderType); IImageLoader loader = (IImageLoader)context.RequestServices.GetService(imageLoaderType);

let me know if you need any further information
regards
Viktor

Net Standard 2.0

I wanted to try out ImageWizard and I noticed that in NuGet there's only the NET 5.0 version of DLL. Is it possible to get net standard 2.0? I'm asking because Net Standard 2.0 allows for higher compatibility with older Net Framework, yet allows you to use the library on Linux and macOS.

webp files partially loaded

Hi,

First of all thanks for this great library. I was looking for a way to dynamically load, resize and cache remote files and this is what I needed.

While processing files I discovered some strange behavior. Webp files are not loaded correcty. There is no difference in loading it remote of from local files. I tracked it down to the SkiaSharpPipline parsing the memory stream.

SKBitmap bitmap = SKBitmap.Decode(context.Result.Data);

I am not sure if this has to be fixed in ImageWizard or that this is something wrong in SkiaSharp.

When you first read the stream to a byte array and use the bytearray in SKBitmap.Decode it works as expected.

using MemoryStream ms = new MemoryStream();
context.Result.Data.CopyTo(ms);
var bytes = ms.ToArray();

SKBitmap bitmap = SKBitmap.Decode(bytes);

I don't know if this creates some new memory usage issues, but at least it is a workaround if you need it.

Suggestion: improve regex for case of many parameters

Hi usercode,

I'm trying to adapt this package (use the core, write my own plugin with skiasharp to match my requirements)
I found that with a filter that requires many parameters, it's a pain to fill all of them.

Example, I want to have a text filter (draw text watermark to an image), so I will have following overloads

  • Text(string base64urlEncodedWatermark)
  • Text(string base64urlEncodedWatermark, string base64urlEncodedFontName)
  • Text(string base64urlEncodedWatermark, string base64urlEncodedFontName, float fontSize)
  • ...

So I plan to update the middle ware to recognize the filter request as

  • /text(text; 'helloworld', font: 'Comic Sans MS', fontSize: 72.0, color: '#00000')/
  • Then I de serialized all parameters inside the '(' ')' pairs to an object/struct parameter
  • Then call the private Text(TextWatermarkOptions option) function, which actually do the job.

Can you review my idea a bit.

I will implement and submit if it's okay.

haiduong87,
Thank you!

Page to upload and manage the images

Hello this is great, to make it more effective and useable for more users adoption,

  • Admin Media page:
  • it would be helpful to have a page to upload bulk images,
  • modifications: See the current image vs. the modified/processed/changed.

Encrypting the URL

Great library!
I looked at your 'How to use it' and the 'unsafe' works as described but when options.Key = Encoding.UTF8.GetBytes("some key"); is set on the service and/or client, and the url is encrypted based on your format with the key and url value, all the request ends up in 'Signature is not valid!' error.

Can there be a description of how to add signature to external urls via a method? i.e. If the images are called from S3 or cloud storage? Not clear if that be done via the UrlBuilder based on the notes provided.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.