[SBC-4238] Windows Example - #28
Open
stedra-apryse wants to merge 37 commits into
Open
stedra-apryse wants to merge 37 commits into
stedra-apryse wants to merge 37 commits into
Conversation
kyrylo-volkov-apryse
requested changes
Jun 11, 2026
kyrylo-volkov-apryse
approved these changes
Jun 12, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…in print functions
kyrylo-volkov-apryse
requested changes
Sep 11, 2026
…ocumentation across examples and test scripts
…document cleanup snippets (Java/Node.js/Python), adjusted enhance parameters, and included new cleanup test scenarios with supporting images
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical CI, Python compatibility, credential-handling, and runtime issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Windows build/test support and updates Python, Node.js, Java, and C examples for SDK 0.1000.3, including document straightening and cleanup APIs.
Changes:
- Adds Windows PowerShell test scripts and Docker stages.
- Updates examples, SDK APIs, documentation, and Linux test infrastructure.
- Adds cross-platform CMake SDK discovery and C API updates.
File summaries
| File | Reviewed change / final note |
|---|---|
test-scripts/windows/test-python.ps1 |
Windows Python command tests. Moderate (3 votes): Add enhance cleanup_document coverage. |
test-scripts/windows/test-c.ps1 |
Windows C command tests. Moderate (3 votes): Add enhance cleanup_document coverage. |
test-scripts/windows/run-all-tests.ps1 |
Windows test-suite orchestrator. |
test-scripts/windows/Dockerfile |
Windows SDK build and verification image. Critical (3 votes): Keep SCANBOT_LICENSE out of image configuration/history. Moderate (3 votes): Use Test-Path to verify the C artifact. Moderate (2 votes): Check native pip exit codes, including line 48. |
test-scripts/README.md |
Test layout and usage documentation. |
test-scripts/linux/test-python.sh |
Updated Python test commands. |
test-scripts/linux/test-nodejs.sh |
Updated Node.js test commands. |
test-scripts/linux/test-java.sh |
Updated Java test commands. |
test-scripts/linux/test-c.sh |
Updated C test commands. |
test-scripts/linux/run-all-tests.sh |
Linux test orchestrator. |
test-scripts/linux/Dockerfile |
Updated test-script copy path. |
Readme.md |
Added example project links. |
examples/python/utils.py |
Updated Python CLI help. |
examples/python/snippets/straightener/document_straightener.py |
Updated straightener API usage. |
examples/python/snippets/live/camera.py |
Cross-platform camera backends. Critical (3 votes): Replace the Python 3.9-only generic annotation for Python 3.6 compatibility. |
examples/python/snippets/document/document_cleanup.py |
Added document cleanup snippet. |
examples/python/README.md |
Windows setup and usage documentation. |
examples/python/main.py |
Python command dispatch updates. |
examples/nodejs/src/snippets/utils/example-usage.ts |
Updated Node.js CLI help. |
examples/nodejs/src/snippets/straightener/document-straightener.ts |
Updated straightener API usage. |
examples/nodejs/src/snippets/document/document-cleanup.ts |
Document cleanup snippet. Moderate (1 vote): Guard result.image access on successful cleanup status. |
examples/nodejs/src/index.ts |
Node.js command dispatch updates. |
examples/nodejs/README.md |
Updated Node.js usage documentation. |
examples/nodejs/package.json |
SDK version update. |
examples/nodejs/package-lock.json |
Locked SDK version update. |
examples/java/src/main/java/io/scanbot/sdk/utils/ExampleUsage.java |
Updated Java CLI help. |
examples/java/src/main/java/io/scanbot/sdk/snippets/straightener/DocumentStraightenerSnippet.java |
Updated straightener API usage. |
examples/java/src/main/java/io/scanbot/sdk/snippets/image/ImageProcessingSnippets.java |
Updated crop API. |
examples/java/src/main/java/io/scanbot/sdk/snippets/document/DocumentCleanupSnippet.java |
Document cleanup snippet. Moderate (1 vote): Guard image access and saving on successful cleanup status. |
examples/java/src/main/java/io/scanbot/sdk/ScanbotSDKExample.java |
Java command dispatch updates. |
examples/java/README.md |
Updated Java usage documentation. |
examples/java/build.gradle |
SDK version update. |
examples/c/src/utils/utils.c |
Updated string-reference handling. |
examples/c/src/snippets/straightener/document_straightener.c |
Updated straightener API usage. |
examples/c/src/snippets/live/live_barcode.c |
Updated string and accelerator APIs. |
examples/c/src/snippets/document/document_cleanup.c |
Document cleanup implementation. Moderate (1 vote): Guard image inspection and saving on successful cleanup status. |
examples/c/src/snippets/datacapture/vin_scanner.c |
Updated string-reference handling. |
examples/c/src/snippets/datacapture/text_pattern_scanner.c |
Updated string-reference handling. |
examples/c/src/snippets/datacapture/ocr.c |
Updated string-reference handling. |
examples/c/src/snippets/datacapture/mrz_parser.c |
Updated parser string API. |
examples/c/src/snippets/datacapture/medical_certificate_scanner.c |
Updated string-reference handling. |
examples/c/src/snippets/barcode/parse_barcode_document.c |
Updated parser string API. |
examples/c/src/snippets/barcode/detect_barcode.c |
Updated string-reference handling. |
examples/c/src/main.c |
C command dispatch updates. |
examples/c/README.md |
Windows build and usage documentation. |
examples/c/include/snippets/straightener/document_straightener.h |
Straightener declaration. |
examples/c/include/snippets/enhancer/document_enhancer.h |
Removed obsolete declaration. |
examples/c/include/snippets/document/document_cleanup.h |
Cleanup declaration. |
examples/c/CMakeLists.txt |
Cross-platform CMake target setup. Moderate (1 vote): Restore CONFIGURE_DEPENDS. |
examples/c/cmake/FindScanbotSDK.cmake |
Cross-platform SDK discovery. |
examples/c/cmake/Download.cmake |
Secure SDK download helper. |
.github/workflows/run-tests-ci.yml |
Updated Linux CI build configuration. Critical (1 vote): Propagate failures through tee using pipefail or PIPESTATUS. |
Review details
Files not reviewed (1)
- examples/nodejs/package-lock.json: Generated file
Suppressed comments (5)
examples/c/CMakeLists.txt:13
- Removing
CONFIGURE_DEPENDSmeans an existing CMake build will not regenerate when a new.cfile is added undersrc, so newly added snippets can be silently omitted until the developer manually reconfigures. Keep the flag that was present before this change.
file(GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
examples/c/src/snippets/document/document_cleanup.c:70
- The result status is retrieved and printed, but the image is accessed unconditionally. For a non-OK cleanup result the image may be absent, so this path can report a failure or dereference an invalid result instead of handling the status; guard image inspection/saving on the SDK's successful status as the Python example does.
ec = scanbotsdk_document_cleanup_result_get_image(result, &cleaned_image);
if (ec != SCANBOTSDK_OK || cleaned_image == NULL) {
fprintf(stderr, "document_cleanup_result_get_image: %d: %s\n", ec, error_message(ec));
goto cleanup;
}
examples/java/src/main/java/io/scanbot/sdk/snippets/document/DocumentCleanupSnippet.java:30
- The result status is printed, but
getImage()is used regardless of that status. A non-OK cleanup result can have no image, causing a null dereference before the caller can handle the reported status; guard image inspection and saving on the SDK's successful status as in the Python snippet.
System.out.println("Document cleanup status: " + result.getStatus());
ImageInfo originalInfo = image.imageInfo();
ImageInfo cleanedInfo = result.getImage().imageInfo();
System.out.printf("Original WxH: %dx%d%n", originalInfo.getWidth(), originalInfo.getHeight());
System.out.printf("Cleaned WxH: %dx%d%n", cleanedInfo.getWidth(), cleanedInfo.getHeight());
examples/nodejs/src/snippets/document/document-cleanup.ts:19
- The result status is logged, but
result.imageis dereferenced unconditionally. When cleanup returns a non-OK status with no output image, this throws instead of handling the status; guard image inspection and saving on the SDK's successful status as in the Python snippet.
test-scripts/windows/Dockerfile:49 - In Windows PowerShell,
$ErrorActionPreference = 'Stop'does not turn nativepipexit codes into terminating errors. A failed SDK install can therefore be followed by the success message and a successfulbaseimage build; explicitly check$LASTEXITCODEafter this command.
- Files reviewed: 50/56 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ENV ARCH=${ARCH} \ | ||
| SDK_VERSION=${SDK_VERSION} \ | ||
| C_SDK_ARCHIVE_URL=${C_SDK_ARCHIVE_URL} \ | ||
| SCANBOT_LICENSE=${SCANBOT_LICENSE} \ |
…ies, update bash commands to use pipefail. Include new document cleanup test scenarios in PowerShell scripts.
kyrylo-volkov-apryse
requested changes
Sep 16, 2026
…nd update default crop optimization with OPTIMIZE_QUAD
kyrylo-volkov-apryse
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.