* Determines if the orientation requires a canvas element. * * @param {object} [options] Options object * @param {boolean} [withMetaData] Is metadata required for orientation * @returns {boolean} Returns true if orientation requires canvas/meta
(options, withMetaData)
| 111 | * @returns {boolean} Returns true if orientation requires canvas/meta |
| 112 | */ |
| 113 | function requiresCanvasOrientation(options, withMetaData) { |
| 114 | var orientation = options && options.orientation |
| 115 | return ( |
| 116 | // Exif orientation for browsers without automatic image orientation: |
| 117 | (orientation === true && !loadImage.orientation) || |
| 118 | // Orientation reset for browsers with automatic image orientation: |
| 119 | (orientation === 1 && loadImage.orientation) || |
| 120 | // Orientation to defined value, requires meta for orientation reset only: |
| 121 | ((!withMetaData || loadImage.orientation) && |
| 122 | orientation > 1 && |
| 123 | orientation < 9) |
| 124 | ) |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Determines if the image requires an orientation change. |
no outgoing calls
no test coverage detected