alexk111 / ngImgCrop

Image Crop directive for AngularJS (THIS PROJECT IS NOT MAINTAINED ANYMORE)
MIT License
1.12k stars 515 forks source link

result-image-quality doesn't work #142

Open abelbarbosa opened 8 years ago

abelbarbosa commented 8 years ago

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.

SergeyMell commented 7 years ago

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

abelbarbosa commented 7 years ago

@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.

SergeyMell commented 7 years ago

@abelbarbosa Thanks a lot for your answer