holder.js
function setInitialDimensions(el) {
	    if (el.holderData) {
	        var dimensions = dimensionCheck(el);
	        if (dimensions) {
	            var flags = el.holderData.flags;

	            var fluidConfig = {
	                fluidHeight: flags.dimensions.height.slice(-1) == '%',
	                fluidWidth: flags.dimensions.width.slice(-1) == '%',
	                mode: null,
	                initialDimensions: dimensions
	            };

	            if (fluidConfig.fluidWidth && !fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'width';
	                fluidConfig.ratio = fluidConfig.initialDimensions.width / parseFloat(flags.dimensions.height);
	            } else if (!fluidConfig.fluidWidth && fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'height';
	                fluidConfig.ratio = parseFloat(flags.dimensions.width) / fluidConfig.initialDimensions.height;
	            }

	            el.holderData.fluidConfig = fluidConfig;
	        } else {
	            setInvisible(el);
	        }
	    }
	}
function setInitialDimensions(el) {
	    if (el.holderData) {
	        var dimensions = dimensionCheck(el);
	        if (dimensions) {
	            var flags = el.holderData.flags;

	            var fluidConfig = {
	                fluidHeight: flags.dimensions.height.slice(-1) == '%',
	                fluidWidth: flags.dimensions.width.slice(-1) == '%',
	                mode: null,
	                initialDimensions: dimensions
	            };

	            if (fluidConfig.fluidWidth && !fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'width';
	                fluidConfig.ratio = fluidConfig.initialDimensions.width / parseFloat(flags.dimensions.height);
	            } else if (!fluidConfig.fluidWidth && fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'height';
	                fluidConfig.ratio = parseFloat(flags.dimensions.width) / fluidConfig.initialDimensions.height;
	            }

	            el.holderData.fluidConfig = fluidConfig;
	        } else {
	            setInvisible(el);
	        }
	    }
	}
function setInitialDimensions ( el ) { if ( el . holderData ) { var dimensions = dimensionCheck ( el ) ; if ( dimensions ) { var flags = el . holderData . flags ; var fluidConfig = { fluidHeight : flags . dimensions . height . slice ( - 1 ) == '%' , fluidWidth : flags . dimensions . width . slice ( - 1 ) == '%' , mode : null , initialDimensions : dimensions } ; if ( fluidConfig . fluidWidth && ! fluidConfig . fluidHeight ) { fluidConfig . mode = 'width' ; fluidConfig . ratio = fluidConfig . initialDimensions . width / parseFloat ( flags . dimensions . height ) ; } else if ( ! fluidConfig . fluidWidth && fluidConfig . fluidHeight ) { fluidConfig . mode = 'height' ; fluidConfig . ratio = parseFloat ( flags . dimensions . width ) / fluidConfig . initialDimensions . height ; } el . holderData . fluidConfig = fluidConfig ; } else { setInvisible ( el ) ; } } }
Sets up aspect ratio metadata for fluid placeholders, in order to preserve proportions when resizing

@private
@param el Image DOM element
Sets up aspect ratio metadata for fluid placeholders in order to preserve proportions when resizing