I am calling GetCropUrl("image", "HomePage") on my Model object and when I look at the src generated it is indeed showing the expected URL matching the width and height of my defined crop i.e.:
Deleted the image and re-added it to my Articulate Post, made sure that the "HomePage" thumbnail shows up in my property editor for the post and published. Nothing changes, still get the same results.
Going to try and get the absolute latest ImageProcessor.dll and try that.
Hmm okay.. Is is only the specific crop size or also other sizes?
It could be a calculation issue..
which version of Umbraco are you using? I am using Umbraco 7.1.4. and have defined a crop size of 220 x 220 and it seems to work fine at this size. So perhaps try to see if it also is an issue with other crop sizes and maybe if you don't use Umbraco 7.1.4 install it via WebMatrix locally, add a property using Image Cropper and the crop size and see if it still is a problem?
Yes, sounds like ImageProcessor.Web is not registered.
Could be potentially a couple of things:
If you have pre v3.2.6 then perhaps you have turned of RAMMFAR, if you have v3.2.6 or above then perhaps the HttpModule isn't registered (example here)?
I would recommend you update to the latest of both ImageProcessor and ImageProcessor.Web from NuGet and ensure that the HttpModule is registered.
I would strongly recommend that you upgrade to the latest version anyway. Jeavon and I are pushing for the next Umbraco release (7.1.5) to include the latest versions also.
I'm using GetCropUrl, everything works fine, but the "quality:" settings bit. It doesn't matter what value i set them, as in "quality:90" or "quality:65",
mine seems to generate the image with the same image file size. Any idea on this? I've installed the latest nuget as well it's still the same
yup the querystring value do change in the html. The weirdest thing is. The uploaded image is 1.29MB, Thought it will compress the image with lower quality set as "quality:90", but it rendered at 1.68MB
I am having the same problem as everyone else here. Currently I have an exception on the following line
var imageCrops = JsonConvert.DeserializeObject<ImageCropDataSet>(Model.Content.GetPropertyValue<string>("picture"));
An exception of type 'System.ArgumentNullException' occurred in Newtonsoft.Json.dll but was not handled in user code
Since I don't understand how the image cropper is working, throwing more lines of code which I do not understand at it, and which crash, does not help. Sorry.
Not sure, I am not too familiar with Umbraco terminology.
To give a bit of background, the site was in Umbraco 4.11.X and I upgraded it to umbraco 7.4.3. Rest all I have been able to make work but this image cropper and 1 issue with replace ucomponent with archtype has driven me crazy.
Regarding the current code it resides in one of master pages under the folder /masterpages, the file name is ContentMaster.master .
I am able to display normal images, I am having issue only with croppers.
Here is more of the code snippet, may be this will help you understand the issue.
I'm pretty sure you are editing a MacroScript which are supported for legacy only and the GetCropUrl method is not supported. You will need to convert to a MacroPartialView then it would work.
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ffe8a1a8\a140437f\AppWebpageheader.cshtml.d673bf47.ah4sh4gj.0.cs(33): error CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ffe8a1a8\a140437f\AppWebpageheader.cshtml.d673bf47.pv1z-nkl.0.cs(33): error CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)
Finally resolved :). Thanks Jeavon. The partial view macro worked , the PublishedContentModel issue was because in the web.config under the folder view was adding it as a namespace. All good now :) Thanks.
GetCropUrl not providing cropped image
I am calling GetCropUrl("image", "HomePage") on my Model object and when I look at the src generated it is indeed showing the expected URL matching the width and height of my defined crop i.e.:
"/media/1096/calcfeatured2-721x407.png?anchor=center&mode=crop&width=80&height=80&rnd=130525227080000000"
However the image is renderd at its full height and width, not at 80 x 80 !
Any ideas how to track this one down. I am seeing nothing in the log files.
Thanks
Russell
Hi Russell
If you have defined a crop with width, height and alias then this should work:
where "myImageProperty" is the property alias using the image cropper and "normal" is the alias of the image crop.
I my case the crop is 220 x 220 px and it would generate this in the image src:
/media/1001/bjarne.jpg?crop=0.093726494922903414,0.066769109627679624,0.078894791274914708,0.31269685502068395&cropmode=percentage&width=220&height=220&rnd=130525261720000000"
/Bjarne
Thanks Bjarne, I believe that I am getting the URL correctly, but the Image Cropper just isnt doing its thing!
Russell
Okay, so how large is the generated image when you look in the source / DOM?
Perhaps try to republish the node or republish entire site from root?
Bjarne, I have tried it all :)
Deleted the image and re-added it to my Articulate Post, made sure that the "HomePage" thumbnail shows up in my property editor for the post and published. Nothing changes, still get the same results.
Going to try and get the absolute latest ImageProcessor.dll and try that.
Russell
Hmm okay.. Is is only the specific crop size or also other sizes?
It could be a calculation issue..
which version of Umbraco are you using? I am using Umbraco 7.1.4. and have defined a crop size of 220 x 220 and it seems to work fine at this size. So perhaps try to see if it also is an issue with other crop sizes and maybe if you don't use Umbraco 7.1.4 install it via WebMatrix locally, add a property using Image Cropper and the crop size and see if it still is a problem?
/Bjarne
Yes, sounds like ImageProcessor.Web is not registered.
Could be potentially a couple of things:
If you have pre v3.2.6 then perhaps you have turned of RAMMFAR, if you have v3.2.6 or above then perhaps the HttpModule isn't registered (example here)?
I would recommend you update to the latest of both ImageProcessor and ImageProcessor.Web from NuGet and ensure that the HttpModule is registered.
Jeavon
Jeavon is on the ball here. It certainly looks like the HttpModule is not registered as the generated url is correct.
There's documentation here for ImageProcessor that indicates what should be present in your Web.Config if you have a version installed >= 3.2.6 http://imageprocessor.org/imageprocessor-web/#webconfig
I would strongly recommend that you upgrade to the latest version anyway. Jeavon and I are pushing for the next Umbraco release (7.1.5) to include the latest versions also.
Jeavon, James, thanks for the help... my web.config file was indeed missing the HttpModule registration.
I was already running v3.2.6 on Umbraco 7.1.4
Awesome. Glad you got it worked out :)
I'm using GetCropUrl, everything works fine, but the "quality:" settings bit. It doesn't matter what value i set them, as in "quality:90" or "quality:65",
mine seems to generate the image with the same image file size. Any idea on this?
I've installed the latest nuget as well it's still the same
Any help will be great
Just to be clear, when you change the quality parameter is the querystring value &quality=xx changing in the rendered html?
yup the querystring value do change in the html. The weirdest thing is. The uploaded image is 1.29MB, Thought it will compress the image with lower quality set as "quality:90", but it rendered at 1.68MB
Can you post the whole image path & querystring and also what dimensions is your original source image?
The image path will be
/media/1150/banner_city.png?center=0.344,0.975&mode=crop&quality=70&width=1600&height=499&rnd=130562233520000000
The original source image size is 1600 width and 499 height
I think that might be bacause your source is png, try adding format=jpg and see if the quality adjusts the size
had tested with a jpg and it can compress the image.
Any way i can render the GetCropUrl as jpg even though the user uploads a png (so that the image compression works?)
Yes, something like this
thanks Jeavon, i'll test it out this afternoon
I am having the same problem as everyone else here. Currently I have an exception on the following line
var imageCrops = JsonConvert.DeserializeObject<ImageCropDataSet>(Model.Content.GetPropertyValue<string>("picture"));
An exception of type 'System.ArgumentNullException' occurred in Newtonsoft.Json.dll but was not handled in user code
Since I don't understand how the image cropper is working, throwing more lines of code which I do not understand at it, and which crash, does not help. Sorry.
Hi Amanda,
Why are you trying to get the crop model manually rather than using the GetCropUrl method?
Jeavon
Hi,
I have the same problem, I just cant get the image cropper to work.
<div>1: @Model.Content.GetCropUrl("heroImage", "PageHeader")</div>
This prints 1:
If try this : -
<div>2: @Model.heroImage</div>
, I get thisCan you please help. I am running umbraco 7.4.3
Regards Ankur
Hi Ankur,
Try
Does it give you anything?
Jeavon
Nopes, it gives blank.
Regards Ankur
Is this code in a MVC View?
Model.heroImage
sounds like it could be a legacy MacroScript...?Not sure, I am not too familiar with Umbraco terminology.
To give a bit of background, the site was in Umbraco 4.11.X and I upgraded it to umbraco 7.4.3. Rest all I have been able to make work but this image cropper and 1 issue with replace ucomponent with archtype has driven me crazy.
Regarding the current code it resides in one of master pages under the folder /masterpages, the file name is ContentMaster.master .
I am able to display normal images, I am having issue only with croppers.
Here is more of the code snippet, may be this will help you understand the issue.
Regards Ankur
The code isn't pasting properly here.
Regards Ankur
I'm pretty sure you are editing a MacroScript which are supported for legacy only and the GetCropUrl method is not supported. You will need to convert to a MacroPartialView then it would work.
I am sure you must be right, now I am trying to call the crop through the MacroPartialView. But when I call the new macro using
I get following error.
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ffe8a1a8\a140437f\AppWebpageheader.cshtml.d673bf47.ah4sh4gj.0.cs(33): error CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)
Could you please post the contents of PageHeader.cshtml?
Here it is
Should just be like this:
Same error:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ffe8a1a8\a140437f\AppWebpageheader.cshtml.d673bf47.pv1z-nkl.0.cs(33): error CS0234: The type or namespace name 'PublishedContentModels' does not exist in the namespace 'Umbraco.Web' (are you missing an assembly reference?)
That's coming from ModelsBuilder, are you using it? You could disable it in web.config or otherwise add
Did both, I still get the same error.
The issue comes whenever I call any MacroPartialView, even if I create an empty one.
Regards Ankur
Finally resolved :). Thanks Jeavon. The partial view macro worked , the PublishedContentModel issue was because in the web.config under the folder view was adding it as a namespace. All good now :) Thanks.
Regards Ankur
is working on a reply...