I know that documentation is allowed for this particular function in the image library. The crop function requires that you feed only on the axis. Then it will crop these axes and return the part of the image that is closer to the center. Therefore, if you set the x axis to 10 and the y axis to 10, it will delete the top 10px images and the left 10 px images. Similarly, if you set the x axis to an image width of 10, it cuts 10 pixels to the right of the image.
What your four positions tell you is really four different axes. Therefore, you need to perform two operations. You just need to change the axis between these $ this-> image_lib-> crop ().
How to determine these axes depends on how you get this data. In an array, as individual values, etc., therefore, I will not go into this.