calculate_lqip_dimensions = function( {
targetBytes,
originalWidth,
originalHeight
} ) {
const targetBlocks = ( targetBytes - 300 ) / 10;
const targetPixels = targetBlocks * 8 * 8,
ar = originalWidth / originalHeight,
h = Math.sqrt( targetPixels / ar ),
w = ar * h;
const width = 8 * Math.round( w / 8 ),
height = 8 * Math.round( h / 8 );
return { width, height };
}