Skip to content

[SBC-4238] Windows Example - #28

Open
stedra-apryse wants to merge 37 commits into
mainfrom
sd/windows
Open

stedra-apryse wants to merge 37 commits into
mainfrom
sd/windows

Conversation

@stedra-apryse

Copy link
Copy Markdown

No description provided.

@stedra-apryse stedra-apryse changed the title Windows Example [SBC-4238] Windows Example Jun 10, 2026
Comment thread examples/c/cmake/FindScanbotSDK.cmake
Comment thread examples/c/CMakeLists.txt Outdated
Comment thread examples/c/CMakeLists.txt
Comment thread examples/c/src/snippets/barcode/detect_barcode.c Outdated
Comment thread examples/python/snippets/live/camera.py
Comment thread examples/c/src/snippets/document/document_straightener.c
Comment thread examples/python/README.md Outdated
…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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_DEPENDS means an existing CMake build will not regenerate when a new .c file is added under src, 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.image is 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 native pip exit codes into terminating errors. A failed SDK install can therefore be followed by the success message and a successful base image build; explicitly check $LASTEXITCODE after 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.

Comment thread .github/workflows/run-tests-ci.yml
Comment thread examples/python/snippets/live/camera.py Outdated
ENV ARCH=${ARCH} \
SDK_VERSION=${SDK_VERSION} \
C_SDK_ARCHIVE_URL=${C_SDK_ARCHIVE_URL} \
SCANBOT_LICENSE=${SCANBOT_LICENSE} \
Comment thread test-scripts/windows/Dockerfile Outdated
Comment thread test-scripts/windows/Dockerfile Outdated
Comment thread test-scripts/windows/test-c.ps1
Comment thread test-scripts/windows/test-python.ps1
…ies, update bash commands to use pipefail.

Include new document cleanup test scenarios in PowerShell scripts.
Comment thread examples/c/src/utils/utils.c Outdated
…nd update default crop optimization with OPTIMIZE_QUAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants