The image is returned with "?mode=max&rnd=130741876440000000" which means ImageProcessing kicks in and the quality of the outputted image is then effected (colour depth reduced).
I'd like to just return "file.gif".
So you can get a better understanding of what's going on, here it all is:
public string GetSquareCrop()
{
// Crop Disabled
if (this.DisableCrop) return this.Url; // call this.GetCropUrl
// Disable ImageProcessing on GIF's
if (this.UmbracoExtension == "gif")
{
// this needs replacing, to just return the image url
return this.GetCropUrl(imageCropMode: ImageCropMode.Max);
}
if (this.UmbracoFile != null) return this.GetResponsiveCropUrl("Square");
return null;
}
So, if I return UmbracoFile, this returns the JSON.
So I am now taking that JSON and making it real ;-)
public string UmbracoFile
{
get
{
var prop = this.GetPropertyValue<string>("umbracoFile");
if (IsJson(prop))
{
dynamic d = JsonConvert.DeserializeObject(prop);
return d.src;
}
return prop;
}
}
I assume this method is actually somewhat unrequited, and I should be able to cast the property into something that does this for me? Rather than this Dynamic wizardry! ;-)
Depending on the ImageProcessor version (v2.3.0+) you might well still get the HttpModule intercepting even if you only use the original src url if you have RAMMFAR enabled in your web.config.
Add ipignore=true to your querystring parameters and ImageProcessor will ignore the request.
I'd love to see the input and output images if I could to see what color loss occurs.
Image Cropper - Getting Original URL
Hello,
I'd like to get the original source URL for an Image that's stored in Umbraco.
The problem is when I use
The image is returned with "?mode=max&rnd=130741876440000000" which means ImageProcessing kicks in and the quality of the outputted image is then effected (colour depth reduced).
I'd like to just return "file.gif".
So you can get a better understanding of what's going on, here it all is:
Many thanks! Laurence
return this.UmbracoFile
? :-)return this.UmbracoFile.src;
?So, if I return UmbracoFile, this returns the JSON.
So I am now taking that JSON and making it real ;-)
I assume this method is actually somewhat unrequited, and I should be able to cast the property into something that does this for me? Rather than this Dynamic wizardry! ;-)
Hi Laurence,
Depending on the ImageProcessor version (v2.3.0+) you might well still get the HttpModule intercepting even if you only use the original src url if you have RAMMFAR enabled in your web.config.
Add
ipignore=true
to your querystring parameters and ImageProcessor will ignore the request.I'd love to see the input and output images if I could to see what color loss occurs.
Cheers
James
The two URLs below, give a really good example of the quality lose, which I assume is a change in colour depth.
Processed: 4.gif?mode=max
Unprocessed: 4.gif
It looks like that's caused by the quantizer used by Gifsicle in the PostProcessor. If you download the configuration project you can disable it.
http://imageprocessor.org/imageprocessor-web/configuration/#processingconfig
is working on a reply...