I want to crop a portrait / landscape image to a centre perfect square image by getting the value of x1, x2, y1, y2. How to do it?
let x = pickedImage.size.width
let y = pickedImage.size.height
// Portrait image
if(pickedImage.size.width < pickedImage.size.height){
//crop image and get value of x1,x2,y1,y2
}
//Landscape image
else if(pickedImage.size.width > pickedImage.size.height) {
//crop image and get value of x1,x2,y1,y2
}