What did you try ? if you can post some code we can try to fathom what might have gone wrong.
Sometimes, if you have created the 'crop' after uploading the image; then opening up that image in the media section and saving it again can prompt the appearance of the cropurl!
If not, then the way to troubleshoot this is to get the media item itself, using something like Umbraco.TypedMedia(mediaId) and verify that Umbraco is returning the Media item correctly; then use GetCropUrl on the media item itself...
eg
var relatedMedia = Umbraco.TypedMedia(content.GetPropertyValue("imagePropertyName"))
var cropUrl = "";
if (relatedMedia != null){
cropUrl = relatedMedia.GetCropUrl("imagePropertyName");
Just an FYI we've used the ImageCropper on 7.3.0 and 7.3.4 without any problems so code would be useful
I vaguely seem to remember we might have seen something similar in 7.3.0 but was related to us using something deprecated that was removed? I could be imagining that though.
when I am using it in partial view I am getting error .
In template i am getting the below errors :
The value of parameter 'id' must be either a string or an integer
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The value of parameter 'id' must be either a string or an integer
Line 57: var featureImage = Umbraco.Content(CurrentPage.newsPic);
Image Cropper not working on umbraco 7.3
Hello,
image Cropper is not working on umbraco 7.3. I tried all possible codes but the src is empty.
Did someone find a fix to the above problem or any solution.
Thanks.
Hi K
What did you try ? if you can post some code we can try to fathom what might have gone wrong.
Sometimes, if you have created the 'crop' after uploading the image; then opening up that image in the media section and saving it again can prompt the appearance of the cropurl!
If not, then the way to troubleshoot this is to get the media item itself, using something like Umbraco.TypedMedia(mediaId) and verify that Umbraco is returning the Media item correctly; then use GetCropUrl on the media item itself...
eg
if that helps ?
Just an FYI we've used the ImageCropper on 7.3.0 and 7.3.4 without any problems so code would be useful
I vaguely seem to remember we might have seen something similar in 7.3.0 but was related to us using something deprecated that was removed? I could be imagining that though.
Hello marc and Dan,
Thank you both for your reply .
I've used : img src='@Umbraco.Content(@CurrentPage.id).GetCropUrl("iamgename", "cropname")' "
But the above is returning empty src.
Have you tried the way described in the docs
where "image" is the doctype property and "banner" is the crop alias.
Reference: https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper
yes i tried but src is empty :(
Try
Hello,
Thnks for your reply I tried it but getting : Error loading Partial View script
are you doing it in a partial view or directly in the template?
I just tried both, and it works fine here.
when I am using it in partial view I am getting error .
In template i am getting the below errors :
The value of parameter 'id' must be either a string or an integer
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The value of parameter 'id' must be either a string or an integer
Line 57: var featureImage = Umbraco.Content(CurrentPage.newsPic);
is working on a reply...