mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 03:00:13 +00:00
* Move early exit for no-rotation. * lol this was meant to be 10 seconds.
This commit is contained in:
@@ -4,10 +4,6 @@ const bpp = 4;
|
||||
|
||||
export function rotate(data: ImageData, opts: RotateOptions): ImageData {
|
||||
const { rotate } = opts;
|
||||
|
||||
// Early exit if there's no transform.
|
||||
if (rotate === 0) return data;
|
||||
|
||||
const flipDimensions = rotate % 180 !== 0;
|
||||
const { width: inputWidth, height: inputHeight } = data;
|
||||
const outputWidth = flipDimensions ? inputHeight : inputWidth;
|
||||
|
||||
Reference in New Issue
Block a user