Skip to content

How to make ImageSharp.Web intercept all image requests including these without querystring #315

Answered by RosenPetrov
RosenPetrov asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your reply again! Excuse me for bothering with Umbraco which is not relevant for this ticket.

I found out why the metadata is not removed for images with no query string. In ImageSharpMiddleware the "commands" are parsed from the query string and even if there are some checks which let the processing happen when ProcessingBehavior.All almost at the end there is this check

// No commands? We simply copy the stream across.
if (commands.Count == 0)
{
    await inStream.CopyToAsync(outStream);
    outStream.Position = 0;
    format = await Image.DetectFormatAsync(this.options.Configuration, outStream);
}
else
{
    FormattedImage image = null;
    try
    {
        // Now we can fi…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@RosenPetrov
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JimBobSquarePants
Comment options

@RosenPetrov
Comment options

Answer selected by RosenPetrov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants