This project is read-only.

Media picker seems to be blurring images

Mar 25, 2013 at 5:11 AM
Hi there

Just need some advice please. We have the Media Picker implemented on our Umbraco website, and the following method call is being made on one of our cshtml pages:

@(DAMP_Helper.GetImageCropperUrl(item, "campaign_rotator"))

The main question I have is:

How does the GetImageCropperUrl method work? Specifically what are the parameters being passed to it? Is there any documentation for this, or what's the easiest way to view the source code and find out what it's doing? I'm pretty sure I can't do any 'Visual Studio' style debugging of this direct from Umbraco, to figure out the method signature right?

The specific problem I'm getting is that the images themselves have been added to Umbraco as content as part of an 'Image Rotator' that I'm guessing is something that's part of the Media Picker. When the above method call is made, it's returning a URL to an image that's smaller than the image originally uploaded, so it appears blurred when it's displayed on the page (which dimensions the image according to the size of the originally uploaded image). I'm trying to figure out how to return images with the original dimensions. Looks like there's an 'image cropper' somewhere that's adjusting the image sizes but I don't know where to find it. Any help appreciated.

Thanks, Chris
Mar 26, 2013 at 4:17 AM
I fixed it :)

the 2nd GetImageCropperUrl method parameter is the name of a 'crop' defined in Umbraco on the 'Image Cropper' data type. I had to go into the 'Developer' section in Umbraco, and edit the 'Image Cropper' data type. I could then add a crop that was the right size for the images in the rotator. I then had to use the Name I'd given to the crop as the 2nd parameter passed to the GetImageCropperUrl method. I also had to re-save the actual images (i.e. the images in Umbraco that had been selected for the image rotator) in order to generate the new crops. In fact it looks like I had to save the images twice for some reason.

I already have a local install of the Umbraco website, so I was able to debug the cshtml page by running the relevant page in the browser and using the 'attach to process' method of debugging to attach to the w3wp process. You can also show a page execution trace by appending ?umbDebugShowTrace=true to the Umbraco URL like this: