Skip to main content
Version: v3

Accept cropped images

A fully cropped image is one that shows only the document, with no surrounding background. Cropping is treated as a form of digital tampering, because a live document presented in a live situation always has physical context around it.

Therefore, by default, Verify will not pass a cropped document unless you explicitly allow it in the configuration.

tip

If you use the Verify SDK, this situation doesn't arise. The SDK only allows images captured in live conditions and does not permit fully cropped images to be submitted.

Accept cropped images​

Cropping is governed by a single boolean setting, verification.settings.cropAffectsVerdict, which defaults to true.

With the default, a cropped document cannot be accepted (cannot receive "Accept" in its verdict). The only verdicts available to it are a rejection or a referral to manual review.

Set cropAffectsVerdict to false when you control the cropping yourself, for example because a client-side SDK does it. Cropped images are then fully processed and can be accepted.

configuration.json
{
"verification": {
"settings": { "cropAffectsVerdict": false }
}
}

The configuration travels as a single JSON configuration part alongside the images:

curl https://us-east.verify.microblink.com/api/v3/verify \
--request POST \
--header 'Authorization: Basic <credentials>' \
--form 'imageFirstSide=@front_id.jpg' \
--form 'imageSecondSide=@back_id.png' \
--form 'configuration=@configuration.json;type=application/json' \
--form 'consent={
"userId": "<your-id-for-the-end-user>",
"durationDays": 365
}'

Reading the result​

Cropping detection is reported in imageAssessment, independently of the setting. Turning cropAffectsVerdict off changes what the verdict does with the detection, not whether the detection runs.

{
"imageAssessment": {
"croppedDocumentCheck": {
"result": "Fail",
"firstSide": { "result": "Fail" },
"secondSide": { "result": "Pass" }
}
}
}

A Fail here means the side was found to be cropped. With cropAffectsVerdict set to false, that finding is informational: verification.verdict can still be Accept.