Skip to content

Reject masks with mismatched dimensions - #119

Merged
esimov merged 1 commit into
esimov:masterfrom
mertkayacs:fix/validate-mask-size
Oct 26, 2026
Merged

esimov merged 1 commit into
esimov:masterfrom
mertkayacs:fix/validate-mask-size

Conversation

@mertkayacs

Copy link
Copy Markdown
Contributor

The README says the -mask and -rmask images have to be the same size as the input, but nothing checks it. A mask of a different size goes through silently, the run exits with 0, and the protected or removed area ends up in the wrong place.

Resize now compares both masks with the input before it starts:

Error resizing the image:
	Reason: mask dimensions 335x223 do not match input dimensions 670x447

The test covers both mask types. go vet and the tests pass on Go 1.22 and 1.26 (face detection tests left to CI).

@esimov
esimov merged commit bc83a33 into esimov:master Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants