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

PreserveSize errors with large image #278

Open
jcbowyer opened this issue Dec 27, 2017 · 1 comment
Open

PreserveSize errors with large image #278

jcbowyer opened this issue Dec 27, 2017 · 1 comment

Comments

@jcbowyer
Copy link

I have been struggling with the cropper on large images.

I have found that the image is not set correctly for large image.

To reproduce:

Modify the sample plunkr to have settings
this.cropperSettings1.preserveSize = true;

And upload the following large image
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73751/world.topo.bathy.200407.3x21600x21600.B2.jpg

The cropped image will not display.

@ovidiua2003
Copy link

ovidiua2003 commented Mar 13, 2018

It's true, the plunker shows the cropped image as broken image. However I have tested locally and it works BUT the resulting crop doesn't have the size i want (150x150) but 1700x1700 from an original image of 5292x3528px;

Also, if I use the same image without preserveSize set to true, the resulting thumbnail is pixelated due to the cropping of the compressed image in the canvas.

Here are my cropper settings:

this.cropperSettings = new CropperSettings(); this.cropperSettings.width = 150; this.cropperSettings.height = 150; this.cropperSettings.croppedWidth =150; this.cropperSettings.croppedHeight = 150; this.cropperSettings.canvasWidth = 230; this.cropperSettings.canvasHeight = 200; this.cropperSettings.rounded = true; this.cropperSettings.keepAspect = true; this.cropperSettings.noFileInput = true; this.cropperSettings.preserveSize = true;

Also cannot add this.cropperSettings.cropOnResize as it's not part of my version of code, which I cannot update due to
npm WARN [email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN [email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN [email protected] requires a peer of @angular/[email protected] but none was installed.

yet those 3 are all at 4.3.5 as my package.json says
"@angular/common": "4.3.5", "@angular/compiler": "4.3.5", "@angular/core": "4.3.5",

Any advice from the author?

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

2 participants