MCPcopy Create free account
hub / github.com/danvk/webdiff / isSameSizeImagePair

Function isSameSizeImagePair

ts/utils.ts:55–62  ·  view source on GitHub ↗
(filePair: FilePair)

Source from the content-addressed store, hash-verified

53
54/** Determines whether the before & after images are the same size. */
55export function isSameSizeImagePair(filePair: FilePair) {
56 if (!filePair.is_image_diff) return false;
57 if (isOneSided(filePair)) return false;
58 if (!filePair.a || !filePair.b) return false;
59 const imA = filePair.image_a,
60 imB = filePair.image_b;
61 return imA.width == imB.width && imA.height == imB.height;
62}
63
64export function assertUnreachable(x: never): never {
65 throw new Error(x);

Callers 3

makePerceptualBoxDivFunction · 0.90
computePerceptualDiffBoxFunction · 0.90
ImageDiffFunction · 0.90

Calls 1

isOneSidedFunction · 0.85

Tested by

no test coverage detected