If you're using the media picker on your document type where you have defined the cropper on your media item.
@if (string.IsNullOrWhiteSpace(CurrentPage.crop.ToString()) == false){
var image = Umbraco.Media(CurrentPage.crop.ToString());
var path = image.umbracoFile;
<img src="@image.GetCropUrl("crop", "box")" />
}
If you're using the cropper on your document type then this should work.
@if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){
var image = Umbraco.Media(CurrentPage.cropLoad.ToString());
}
And are you using the image cropper on a document type, which you call directly (Which the code in your first post implies) or are you using a media picker to pick an image where the image cropper is defined?
Perhaps some screendumps of your setup could help.
Ok...what is your local setup? Are you using IIS or IIS express?
Not sure what the issue could be, but it's always a good idea to clear the browser cache since there is some pretty hefty cache in Umbraco 7 - Do you have the same issue if you try in other browsers?
If you are able to describe step-by-step how this error happens I think you should try reporting an issue at the issue tracker or perhaps if you have bought a support license then try adding a zendesk ticket about this issue.
I created the site Localy using Webmatrix and Umbraco 7.-- The Crops worked fine. I then uploaded the site to my server using IIS and the crops failed. The crops also failed on my local IIS.
The solution was to perform windows updates to resolve the .net issue. This resolved the issue localy and remotly.
Crop (again)
Almost working - but doing this:
img src="@CurrentPage.GetCropUrl("billede", "Nyhed")"
gives me the image i the HTML - but not cropped ??
This is the HTML - it renders the image - but full size.
img src="/media/1013/desert.jpg?crop=0.093749999999999958,0.35102739726027382,0.64940068493150693,0.30650684931506877 &cropmode=percentage&width=200&height=200&rnd=635312706924570312"
Hmm Image Processor (which is part of 7.1) should do that for you. Are you using the RC of 7.1? Maybe it's better to report it here: http://issues.umbraco.org/dashboard#newissue=yes
Jeroen
Hi Brian
The following to examples are working in 7.1
If you're using the media picker on your document type where you have defined the cropper on your media item. @if (string.IsNullOrWhiteSpace(CurrentPage.crop.ToString()) == false){
}
If you're using the cropper on your document type then this should work. @if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){ var image = Umbraco.Media(CurrentPage.cropLoad.ToString()); }
Hope this helps.
/Jan
Ok, the formatting just messed up.
I'm posting both examples seperate now.
@if (string.IsNullOrWhiteSpace(CurrentPage.crop.ToString()) == false){
}
@if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){ var image = Umbraco.Media(CurrentPage.cropLoad.ToString()); }
Strange - it's like my local IIS is not picking up on the crop-info.
Everything looks ok - but the picture is full-size
Hi Brian
Are you using 7.1 beta or 7.1rc?
And are you using the image cropper on a document type, which you call directly (Which the code in your first post implies) or are you using a media picker to pick an image where the image cropper is defined?
Perhaps some screendumps of your setup could help.
Cheers,
Jan
Yep - 7.1 RC and the cropper directly on the document type.
I'll try an external host and se if it me or the IIS :)
Hi Brian
Ok, looking forward to hearing about your progress.
Having a glance at the code samples I posted earlier I can see one of them don't really make sense and that's the one for the scenario you describe.
So I'll try posting it agian but this time written so it should work
@if (string.IsNullOrWhiteSpace(CurrentPage.cropLoad.ToString()) == false){
var image = Umbraco.Media(CurrentPage.cropLoad.ToString());
<img src="@image.GetCropUrl("billede","nyhed")" />
}
Hope this helps - Please notice I'm using ToString()...not sure why it's neccesary but it made the difference for working/not working.
/Jan
Ok - it's my local IIS - hmm??
Tried on a external host and it worked.
Back to the local IIS or Umbraco installation?
Hi Brian
Ok...what is your local setup? Are you using IIS or IIS express?
Not sure what the issue could be, but it's always a good idea to clear the browser cache since there is some pretty hefty cache in Umbraco 7 - Do you have the same issue if you try in other browsers?
/Jan
It's IIS on a Windows 7.
It's the same in different browsers.
I'll try some changes to the IIS.....
Ok, please share if you figure out what is going on :)
/Jan
Thinking it could be the .net package that Umbraco uses for cropping - it's like the parameters attached to the .jpg-file is not getting interpret.
Hi Brian
If you are able to describe step-by-step how this error happens I think you should try reporting an issue at the issue tracker or perhaps if you have bought a support license then try adding a zendesk ticket about this issue.
I hope this helps.
/Jan
Hi,
I had this same issue.
I created the site Localy using Webmatrix and Umbraco 7.-- The Crops worked fine. I then uploaded the site to my server using IIS and the crops failed. The crops also failed on my local IIS.
The solution was to perform windows updates to resolve the .net issue. This resolved the issue localy and remotly.
Thanks,
Mark
is working on a reply...