Using the URL that Richard provided, it seems to be exactly as Jeroen describes. Resizing works but including the quality= parameter forces the original image to be returned with no resizing at all.
According to http://umbraco.com/follow-us/blog-archive/2016/7/19/umbraco-750-beta2-released/, only a few commands will be run by default now for security reasons. Though the Quality= parameter should be one of them. And even if it were disabled the other querystring parameters should still fire, which isn't the case.
In the ApplicationStarted event we have the following code:
// Intercept ImageProcessor requests to alter output quality and file size.
ImageProcessingModule.OnProcessQuerystring += (sender, args) =>
{
// if query string is empty, than we are not using the processor
if (string.IsNullOrEmpty(args.Querystring))
{
return args.Querystring;
}
// reduce quality of jpg images to 85 percent
if ((args.RawUrl.Contains(".jpg") || args.RawUrl.Contains(".jpeg")) && !args.Querystring.Contains("quality="))
{
return args.Querystring += "&quality=85";
}
if (args.RawUrl.Contains(".gif") || args.RawUrl.Contains(".png"))
{
return args.Querystring;
}
return string.Empty;
};
Not sure if that affects the above issue. It worked on Umbraco 7.3 (and the version of ImageProcessor that came with that).
Sorry for all the confusion. Indeed it was a problem with our ImageProcessingModule.OnProcessQuerystring event.
We updated this to the following code:
// Intercept ImageProcessor requests to alter output quality and file size.
ImageProcessingModule.OnProcessQuerystring += (sender, args) =>
{
// if query string is empty, than we are not using the processor
if (string.IsNullOrEmpty(args.Querystring))
{
return args.Querystring;
}
// reduce quality of jpg images to 85 percent
if (args.RawUrl.Contains(".jpg") || args.RawUrl.Contains(".jpeg"))
{
if (!args.Querystring.Contains("quality="))
{
return args.Querystring += "&quality=85";
}
else
{
return args.Querystring;
}
}
if (args.RawUrl.Contains(".gif") || args.RawUrl.Contains(".png"))
{
return args.Querystring;
}
return string.Empty;
};
The old code always returned string.Empty if there was a quality parameter in the url. With this new version you can also use the quality parameter.
Quality Parameter for Images (GetCropUrl Azure Blob Storage)
Hi All,
I'm using GetCropUrl for images in Umbraco 7.4.3. while media is stored in Azure Blob Storage. Imageprocessor installed is version 2.4.4.
The crops are working as expected. The image cache in Aure is also configured and working as expected.
I'm experiencing a problem using the quality parameter (e.a. ?quality=70). It does not seem to effect the image.
Anyone else have the same problem or know wat the problem is?
Hi Richard,
Could you please post an example url where you have the issue?
Jeavon
Hi Jeavon,
An example url: https://www.newheroes.com/media/2846/homepage-still.jpg?anchor=center&mode=crop&width=1920&height=1080&quality=20
Either the quality processor is disabled or something is hijacking the request, can you check the processing.config file for
We have the same problem. And tried the things in the topic.
We're on Umbraco 7.4.3.
We upgraded to ImageProcessor.Web 4.6.6.0.
After that we changed our processing config to this: https://github.com/JimBobSquarePants/ImageProcessor/blob/Framework/src/ImageProcessor.Web/Configuration/Resources/processing.config.transform
When we add the quality parameter it seems to return the original images and ignores all the parameters. Has anyone seen this before?
Jeroen
Using the URL that Richard provided, it seems to be exactly as Jeroen describes. Resizing works but including the quality= parameter forces the original image to be returned with no resizing at all.
Original image (1.3MB): https://www.newheroes.com/media/2846/homepage-still.jpg
Resized to 400px (18.3KB): https://www.newheroes.com/media/2846/homepage-still.jpg?width=400
Resize and set quality (1.3MB): https://www.newheroes.com/media/2846/homepage-still.jpg?width=400&quality=5
According to http://umbraco.com/follow-us/blog-archive/2016/7/19/umbraco-750-beta2-released/, only a few commands will be run by default now for security reasons. Though the Quality= parameter should be one of them. And even if it were disabled the other querystring parameters should still fire, which isn't the case.
cheers,
doug.
In the ApplicationStarted event we have the following code:
Not sure if that affects the above issue. It worked on Umbraco 7.3 (and the version of ImageProcessor that came with that).
Our media is also stored in Azure Blob Storage.
Jeroen
Upgraded from ImageProcessor.Web.Config 2.2 to 2.3, but that also didn't help.
Jeroen
Sorry for all the confusion. Indeed it was a problem with our ImageProcessingModule.OnProcessQuerystring event.
We updated this to the following code:
The old code always returned string.Empty if there was a quality parameter in the url. With this new version you can also use the quality parameter.
Jeroen
is working on a reply...