ngImgCrop icon indicating copy to clipboard operation
ngImgCrop copied to clipboard

get position and size of selection area

Open rydn opened this issue 10 years ago • 16 comments

Is there any way to get the current size of the selection area and its position relative to the original image? Would me most useful indeed!

rydn avatar Aug 05 '14 09:08 rydn

I would like this also... it would be great to have another attr specified IE:

<img-crop
  image="{string}"
  result-image="{string}"
  ...
  area-coords="{expression}"
></img-crop>

where img-crop would assign the coordinates to a variable specified in the expression.

I could see coordinates as: {top, left, width, height}

I could start putting together a pull request if you haven't already started!
Thanks for the great code, @alexk111

mpolichette avatar Aug 12 '14 22:08 mpolichette

+1 on this - would be great to see the size of the cropped image as you crop. Like tooltips stating the w/h in pxs @alexk111 great work indeed

darrenahunter avatar Aug 18 '14 06:08 darrenahunter

any update on it?

mubasshir avatar Oct 27 '14 09:10 mubasshir

+1 please

artemverbo avatar Nov 11 '14 21:11 artemverbo

+1. Size especially since if larger than e.g. mvc maxJsonLength the request would fail not even reaching the actions. Unless there is a way today even using dataUris? I guess if the result image can be the File object somehow, then the size would be possible to obtain (according to MDN Blob.size)

katlimruiz avatar Nov 26 '14 05:11 katlimruiz

+1 You may want to store the original and create higher res crops in the future. Or you may want to have additional (e.g. small, medium, and large) crops which could be done on the server side.

Jermanis avatar Dec 28 '14 16:12 Jermanis

+1 on this too. Would be very useful

jfitz0 avatar Jan 19 '15 05:01 jfitz0

+1. I think the crop info was part of 'crop result',it's will be very useful.

braveoyster avatar Jan 30 '15 03:01 braveoyster

+1 I think there is a PR here: https://github.com/alexk111/ngImgCrop/pull/7 What are the chances, that this gets merged?

23tux avatar Mar 21 '15 18:03 23tux

I had a look into https://github.com/alexk111/ngImgCrop/pull/7/commits and https://github.com/alexk111/ngImgCrop/pull/56 but it seems, that they don't provide x, y and size values relative to the original images resolution.

What would be a good way to implement this?

23tux avatar Mar 22 '15 11:03 23tux

+1 for #7 @alexk111 :)

cspeer avatar Mar 31 '15 11:03 cspeer

+1!

fastf0rward avatar Apr 08 '15 13:04 fastf0rward

+1

migsc avatar Jun 05 '15 13:06 migsc

For those interested, I've forked the repo to add the expected feature at https://github.com/Javarome/ngImgCrop See demo at http://codepen.io/Javarome/pen/RPLZvd

Javarome avatar Jun 27 '15 15:06 Javarome

Thank you very much @Javarome. I will be using your forked version of the lib from now on.

MaximilianLloyd avatar Jul 09 '16 00:07 MaximilianLloyd

@Javarome I don't even know if your lib is what i need. All i really want is to prevent the lib changing the result-image to 200x200? Is there any simple way to do this? I have been struggling all night.

MaximilianLloyd avatar Jul 09 '16 00:07 MaximilianLloyd