alexk111 / ngImgCrop

Image Crop directive for AngularJS (THIS PROJECT IS NOT MAINTAINED ANYMORE)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

result-image-quality doesn't work

abelbarbosa opened this issue · comments

I'm using ngImgCrop with ng-file-upload.

Everything works perfect except that the resulting image is 4 times bigger (disk space) than the original, despite having 1/4 of the dimensions.
I've tried to set type to jpg and the result-image-quality to 0.5 but the resulting size is always the same.

<img-crop image="originalImg | ngfDataUrl" result-image-size="500" result-image-format="image/jpg" result-image-quality="0.5"
            area-type="square" result-image="cover" ng-init="cover=''">
</img-crop>

My objective was to get a smaller image in size (disk space) and dimensions.

Shouldn't it be smaller? Why is the resulting image so big?

Thank you.

I faced the same issue. Tried to set different qualities but no luck... Result image size was always the same.

@SergeyMell This project was abandoned 2 years ago so you should use an alternative like ui-cropper that works in a very similar way with more freedom, options and actively maintained.
Also you can compress the image in the server side. Currently I'm using imagemin for node. You can see an example here. Hope it helps.

Cheers.

@abelbarbosa Thanks a lot for your answer