build/index.js
function exif2css(orientation) {
  const s = `${orientation}`
  const transforms = transformsMap[s]

  const transform = expandTransform(transforms)
  const transformOrigin = transformOriginMap[s]
  const allTransforms = expandTransforms(transforms)
  const allTransformStrings = expandTransformStrings(transforms)

  const css = {}
  if (transform) {
    css['transform'] = transform
  }
  if (transformOrigin) {
    css['transform-origin'] = transformOrigin
  }
  if (allTransforms) {
    css['transforms'] = allTransforms
  }
  if (allTransformStrings) {
    css['transformStrings'] = allTransformStrings
  }
  return css
}
function exif2css(orientation) {
  const s = `${orientation}`
  const transforms = transformsMap[s]

  const transform = expandTransform(transforms)
  const transformOrigin = transformOriginMap[s]
  const allTransforms = expandTransforms(transforms)
  const allTransformStrings = expandTransformStrings(transforms)

  const css = {}
  if (transform) {
    css['transform'] = transform
  }
  if (transformOrigin) {
    css['transform-origin'] = transformOrigin
  }
  if (allTransforms) {
    css['transforms'] = allTransforms
  }
  if (allTransformStrings) {
    css['transformStrings'] = allTransformStrings
  }
  return css
}
function exif2css ( orientation ) { const s = ` ${ orientation } ` const transforms = transformsMap [ s ] const transform = expandTransform ( transforms ) const transformOrigin = transformOriginMap [ s ] const allTransforms = expandTransforms ( transforms ) const allTransformStrings = expandTransformStrings ( transforms ) const css = { } if ( transform ) { css [ 'transform' ] = transform } if ( transformOrigin ) { css [ 'transform-origin' ] = transformOrigin } if ( allTransforms ) { css [ 'transforms' ] = allTransforms } if ( allTransformStrings ) { css [ 'transformStrings' ] = allTransformStrings } return css }
Takes the input EXIF orientation and returns the CSS rules needed to display the image correctly in the browser.
@param {(number|string)} orientation The EXIF orientation.
@returns {Exif2CssReturn} An object with `transform`, `transform-origin` (not shown in JSDoc because of hyphen), `transforms` and `transformStrings` properties.
Takes the input EXIF orientation and returns the CSS rules needed to display the image correctly in the browser .