When painting and a largement of a photo onto a wall how do you determine the ratio that will serve as a scale for the painting

divide the available with and height by those of the photo.

Use the smaller ratio, since otherwise the painting will be too big.