MCPcopy Index your code
hub / github.com/blueimp/JavaScript-Load-Image / requiresCanvasOrientation

Function requiresCanvasOrientation

js/load-image-orientation.js:113–125  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected