i am using this code for crop a layer (selection has been set before)
Then i get the layer with only the croped part of the image.
If the layer has been resized with the mouse before set the selection and crop the image, the result is defomed, this means the croped new content doesn't look like expected. It is much more growing wider.
I hope someone can help me. I try to explain it in the attached jpg file.