CrackerakiUA / ngImgCropFullExtended

Image Crop directive for AngularJS

Home Page:http://crackerakiua.github.io/ngImgCropFullExtended/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

result-image-quality doesn't work

abelbarbosa opened this issue · comments

I'm using ngImgCropFullExtended 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.1 but the resulting size is just 1kb smaller.

<img-crop image="originalImg | ngfDataUrl" result-image-size="500" result-image-format="image/jpg" result-image-quality="0.1"
           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.

Can you please search in Issues, i think we have solve this in other topics.

@abelbarbosa have you already found a solution?
I think that the crop is made from a base64 / png and png are bigger then jpg.

I'm cleaning up the issues to focus on the issues and make the product better.
If you still have questions feel free to re-open the issue.

Same issue here. Resulting image is much bigger then original one. Any solution? 😢

@bazaglia The only solution I've found was using imagemin with ngImgCropFullExtended. I'm currently using imagemin-mozjpeg and imagemin-pngquant plugins - something like this:

const imageminMozjpeg = require('imagemin-mozjpeg'),
    imageminPngquant = require('imagemin-pngquant');

imagemin([input], output, {
    plugins: [
        imageminMozjpeg(),
        imageminPngquant({ quality: '65-80' })
    ]
});

Where "[input]" is an array of images and "output" is the output directory.

Hope it helps. Cheers.