* Determines orientation combinations that require a rotation by 180°. * * The following is a list of combinations that return true: * * 2 (flip) => 5 (rot90,flip), 7 (rot90,flip), 6 (rot90), 8 (rot90) * 4 (flip) => 5 (rot90,flip), 7 (rot90,flip), 6 (rot90), 8 (rot90) * * 5 (rot
(orientation, autoOrientation)
| 158 | * @returns {boolean} Returns true if rotation by 180° is required |
| 159 | */ |
| 160 | function requiresRot180(orientation, autoOrientation) { |
| 161 | if (autoOrientation > 1 && autoOrientation < 9) { |
| 162 | switch (orientation) { |
| 163 | case 2: |
| 164 | case 4: |
| 165 | return autoOrientation > 4 |
| 166 | case 5: |
| 167 | case 7: |
| 168 | return autoOrientation % 2 === 0 |
| 169 | case 6: |
| 170 | case 8: |
| 171 | return ( |
| 172 | autoOrientation === 2 || |
| 173 | autoOrientation === 4 || |
| 174 | autoOrientation === 5 || |
| 175 | autoOrientation === 7 |
| 176 | ) |
| 177 | } |
| 178 | } |
| 179 | return false |
| 180 | } |
| 181 | |
| 182 | // Determines if the target image should be a canvas element: |
| 183 | loadImage.requiresCanvas = function (options) { |
no outgoing calls
no test coverage detected