Skip to content

Support for S3 Presigned URLs? #5

@magicjar

Description

@magicjar

Which version are you using?

1.0.1

Bug summary

Hi,

First of all, thanks for this great library! I have been using it and it works flawlessly when loading images from a unsigned S3 link. However, when I try to use a Presigned URL, I encounter the following error.

SixLabors.ImageSharp.UnknownImageFormatException: Image cannot be loaded. Available decoders:
 - Webp : WebpDecoder
 - TIFF : TiffDecoder
 - TGA : TgaDecoder
 - GIF : GifDecoder
 - PBM : PbmDecoder
 - BMP : BmpDecoder
 - PNG : PngDecoder
 - QOI : QoiDecoder
 - JPEG : JpegDecoder

   at SixLabors.ImageSharp.Formats.ImageFormatManager.ThrowInvalidDecoder(ImageFormatManager manager)
   at SixLabors.ImageSharp.Image.InternalDetectFormat(Configuration configuration, Stream stream)
   at SixLabors.ImageSharp.Image.DiscoverDecoder(DecoderOptions options, Stream stream)
   at SixLabors.ImageSharp.Image.DecodeAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Image.<>c__DisplayClass82_0.<LoadAsync>b__0(Stream s, CancellationToken ct)
   at SixLabors.ImageSharp.Image.WithSeekableStreamAsync[T](DecoderOptions options, Stream stream, Func`3 action, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Web.FormattedImage.LoadAsync(DecoderOptions options, Stream source)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(ImageCommandContext imageCommandContext, IImageResolver sourceImageResolver, ImageContext imageContext, Boolean retry)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(ImageCommandContext imageCommandContext, IImageResolver sourceImageResolver, ImageContext imageContext, Boolean retry)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Questions:

  • Does this library support S3 presigned URLs?
  • If not, is there a recommended workaround?

Steps to reproduce

Load any image from S3 presigned url

Expected result / actual result

It should load and ImageSharp will cache it

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions