Searches for the smallest (?) suitable image from the sizes array.
Or more precise, it returns:
– if no suitable sizes (>= minWidth И >= minHeight): the biggest from all sizes;
– there are any suitable (>= minWidth И >= minHeight): the smallest of the matching sizes;
Returns null only in case of an empty/invalid array. The returned size can be smaller than minWidth or minHeight.
The function doesn't take into about the retina screen (window.devicePixelRatio), so you have to calculate the right width/height from the outside to support it.
WARN:
does not reckon for letter-sizes (PhotosPhotoSizesType).
does not know how to search for the "nearest" size, or the maximum image (there is a hack with the Infinity pass).
Searches for the smallest (?) suitable image from the sizes array.
Or more precise, it returns: – if no suitable sizes (>= minWidth И >= minHeight): the biggest from all sizes; – there are any suitable (>= minWidth И >= minHeight): the smallest of the matching sizes;
Returns null only in case of an empty/invalid array. The returned size can be smaller than minWidth or minHeight.
The function doesn't take into about the retina screen (window.devicePixelRatio), so you have to calculate the right width/height from the outside to support it.
WARN:
Infinity
pass).