cd52a2f82f
Browser-based photo catalog with an optional team server (SQLite + LibRaw). Local database, uploaded photos, build output and dependencies are gitignored. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
30 lines
993 B
TypeScript
30 lines
993 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { outputSize } from '../gl/renderer';
|
|
import { defaultEdits } from './edits';
|
|
|
|
describe('export output dimensions', () => {
|
|
it('matches the source for an uncropped image', () => {
|
|
expect(outputSize(defaultEdits(), 6000, 4000)).toEqual({ w: 6000, h: 4000 });
|
|
});
|
|
|
|
it('swaps dimensions for a quarter turn', () => {
|
|
const edits = defaultEdits();
|
|
edits.crop.quarter = 1;
|
|
expect(outputSize(edits, 6000, 4000)).toEqual({ w: 4000, h: 6000 });
|
|
});
|
|
|
|
it('includes the triangular points added by straightening', () => {
|
|
const edits = defaultEdits();
|
|
edits.crop.angle = 45;
|
|
expect(outputSize(edits, 4000, 3000)).toEqual({ w: 4950, h: 4950 });
|
|
});
|
|
|
|
it('applies the crop after the rotated frame is calculated', () => {
|
|
const edits = defaultEdits();
|
|
edits.crop.angle = 45;
|
|
edits.crop.w = 0.5;
|
|
edits.crop.h = 0.5;
|
|
expect(outputSize(edits, 4000, 3000)).toEqual({ w: 2475, h: 2475 });
|
|
});
|
|
});
|