diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5987bf4ed7..6985b5c130 100644
|
|
|
2829 | 2829 | /** |
2830 | 2830 | * Return whether the image must be cropped, based on required dimensions. |
2831 | 2831 | * |
2832 | | * @param {bool} flexW |
2833 | | * @param {bool} flexH |
2834 | | * @param {int} dstW |
2835 | | * @param {int} dstH |
2836 | | * @param {int} imgW |
2837 | | * @param {int} imgH |
2838 | | * @return {bool} |
| 2832 | * @param {boolean} flexW Width is flexible. |
| 2833 | * @param {boolean} flexH Height is flexible. |
| 2834 | * @param {number} dstW Required width. |
| 2835 | * @param {number} dstH Required height. |
| 2836 | * @param {number} imgW Provided image's width. |
| 2837 | * @param {number} imgH Provided image's height. |
| 2838 | * @return {boolean} Whether cropping is required. |
2839 | 2839 | */ |
2840 | 2840 | mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) { |
2841 | 2841 | if ( true === flexW && true === flexH ) { |
… |
… |
|
2858 | 2858 | return false; |
2859 | 2859 | } |
2860 | 2860 | |
| 2861 | if ( imgH <= dstH ) { |
| 2862 | return false; |
| 2863 | } |
| 2864 | |
| 2865 | // Skip cropping of the image's aspect ratio is the same as the required aspect ratio. |
| 2866 | if ( Math.abs( ( dstW / dstH ) - ( imgW / imgH ) ) < 0.00001 /* Number.EPSILON */ ) { |
| 2867 | return false; |
| 2868 | } |
| 2869 | |
2861 | 2870 | return true; |
2862 | 2871 | }, |
2863 | 2872 | |