Resize image to specific dimension (X to Y ratio)

If the last parameter $crop is true, then »images will be cropped to the specified dimensions using center positions«, with »(…) an array can specify positioning of the crop area« – this is generally called hard crop. But you have to make sure that the images are big enough to actually crop the size you want in the end. More information is available at the add_image_size() documentation.

Without having to crop you have to upload images with the correct X to Y ratio, because otherwise, in soft proportional crop mode, it will be resized, to either the X or Y value you have given in the add_image_size() call, whichever is met first. All of that is explained at the documentation for add_image_size().