Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have an umbraco 7 website where i use the imagecropper to give image in different sizes depending on which device you use.
On desktop the crop is 1440*710
I have uploaded an image that is optimised for web for the imagesize is 160KB and 1440*710.
But if i use the cropper to get the image the imagesize is twice as big. 329KB
Does anybody know why this is?
Hi Anne,
As you are cropping the image it is being recreated. Do you have a quality variable on your url (I think it got slightly cut off)?
Jeavon
No i don't have that. How do i do that?
Could you post your code with the GetCropUrl method?
Yes, I do like this:
var media = helper.TypedMedia(Id);
media .GetCropUrl("Desktop");
Great, so you should be able to do this:
media.GetCropUrl(cropAlias: "Desktop", furtherOptions: "&quality=80");
Thanks. Now it is 263KB so it helped. Do you know where i kan find a description of what i can put in "furtherOptions"?
Yes, you can use any method listed on the ImageProcessor.Web documentation here
When i use quality as a parameter the width and height disappears from the url
before
/media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&width=1440&height=710&rnd=130711490020000000
After
media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&quality=60&rnd=130718462820000000
Now the image is not cropped in the correct size. How do i get the width and height back?
Ah try this:
media.GetCropUrl(cropAlias: "Desktop", useCropDimensions:true, furtherOptions: "&quality=80");
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Imagesize bigger with imagecropper than without
Hi,
I have an umbraco 7 website where i use the imagecropper to give image in different sizes depending on which device you use.
On desktop the crop is 1440*710
I have uploaded an image that is optimised for web for the imagesize is 160KB and 1440*710.
But if i use the cropper to get the image the imagesize is twice as big. 329KB
Does anybody know why this is?
Hi Anne,
As you are cropping the image it is being recreated. Do you have a quality variable on your url (I think it got slightly cut off)?
Jeavon
No i don't have that. How do i do that?
Could you post your code with the GetCropUrl method?
Yes, I do like this:
var media = helper.TypedMedia(Id);
media .GetCropUrl("Desktop");
Great, so you should be able to do this:
Thanks. Now it is 263KB so it helped. Do you know where i kan find a description of what i can put in "furtherOptions"?
Yes, you can use any method listed on the ImageProcessor.Web documentation here
When i use quality as a parameter the width and height disappears from the url
before
/media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&width=1440&height=710&rnd=130711490020000000
After
media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&quality=60&rnd=130718462820000000
Now the image is not cropped in the correct size. How do i get the width and height back?
Ah try this:
is working on a reply...