Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image crops to bad quality image #271

Open
renilbabu03 opened this issue Nov 21, 2017 · 0 comments
Open

Image crops to bad quality image #271

renilbabu03 opened this issue Nov 21, 2017 · 0 comments

Comments

@renilbabu03
Copy link

I used this library to crop the image but the cropped image has astoundingly poor quality. I tried again by going through the similar issue here but failed to fix it.
My HTML
<img-cropper [image]="data1" [settings]="cropperSettings1" (onCrop)="cropped($event)"></img-cropper>

And my typescript configuration

this.cropperSettings1 = new CropperSettings();
    //cropper width
    this.cropperSettings1.width = 200;
    this.cropperSettings1.height = 200;

    //resulting image width / height
    this.cropperSettings1.croppedWidth = 100;
    this.cropperSettings1.croppedHeight = 30;

    this.cropperSettings1.canvasWidth = 500;
    this.cropperSettings1.canvasHeight = 300;
    
    //min width of chopper
    this.cropperSettings1.minWidth = 100;
    this.cropperSettings1.minHeight =30;

    this.cropperSettings1.rounded = false;
    this.cropperSettings1.keepAspect = false;

    this.cropperSettings1.cropperDrawSettings.strokeColor = 'rgba(255,255,255,1)';
    this.cropperSettings1.cropperDrawSettings.strokeWidth = 1;

    this.cropperSettings1.minWithRelativeToResolution = false
    
    // this.cropperSettings1.preserveSize = true;
    // this.cropperSettings1.cropOnResize = false;
    // this.cropperSettings1.compressRatio = 5;
    // this.angularCropper.cropper.zoom(0.1);
    
    this.data1 = {};

I want to crop the image to 100x30 pixel without compromising the quality of the image.

I also tried to open the demo app but is not opening. After doing
npm run all. its giving me the following error

pro

Also the resolution of the image is degraded...Can you help me in this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant