cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

get unscaled crop of image #87

Closed Popl7 closed 8 years ago

Popl7 commented 8 years ago

I am trying to crop a part of a high resolution image. The cropper makes the crop of the scaled down version as shown in the canvas. Is it possible to have the crop from the unscaled image?

I have tested this on the plunkr and it behaves the same here.

This is wat I tried:

And this is what I expected. I expected to get a 720pixels height crop of the big image, shown scaled down to 200px.

It looks like this now: screen shot 2016-10-20 at 15 29 38

This is a really rough crop of the scaled down 4000x2000px image. The text is jagged and not crisp.

Is this something I can do with the cropper?

Popl7 commented 8 years ago

This is the test image I used: digital_video_resolutions_ vcd_to_4k svg

And this is a crop I made to show the cleanless of the 720P text: screen shot 2016-10-20 at 15 34 13

cstefanache commented 8 years ago

Try using this when displaying the result: <img [src]="data1.image" [width]="cropperSettings1.cropWidth" [height]="cropperSettings1.cropHeight">

(cropWidth instead of croppedWidth - I think this is a resolution problem

Popl7 commented 8 years ago

This does show the crop in the resolution it should be, but not in the quality it should. The base64 crop also hasn't changed so the data1.image is still low res.

screen shot 2016-10-20 at 16 23 21

Popl7 commented 8 years ago

it seams that the cropping is done on the canvas and not on a the original image.

cstefanache commented 8 years ago

Fixed! Unfortunately I need to to more tests to see if I am not breaking anything. How urgent is the fix?

image

Popl7 commented 8 years ago

:-) nice. It is not breaking for us but a fix would be really nice. Is there a way for us to try this before it is merged?

cstefanache commented 8 years ago

fixed ... will be released today

Popl7 commented 8 years ago

I will try it this weekend. Thx a lot for the lightning quick action!

Popl7 commented 8 years ago

This works really good! Thx again

cstefanache commented 8 years ago

well ... i will chek it in master, you checkout the code and do a npm run all that will open a demo app in the browser.

thanks for the issue. On Thu, 20 Oct 2016 at 19:19, StevenT notifications@github.com wrote:

:-) nice. It is not breaking for us but a fix would be really nice. Is there a way for us to try this before it is merged?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/cstefanache/angular2-img-cropper/issues/87#issuecomment-255154614, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7c4cVW6UHxX_Mvyefm9rq8Muvla0dCks5q15SOgaJpZM4KcIaZ .

renilbabu03 commented 6 years ago

I am facing the same issue. 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..