Skip to content

Extract shared image utilities to reduce duplication#2880

Merged
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/dedup-get-image-data
Feb 25, 2026
Merged

Extract shared image utilities to reduce duplication#2880
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/dedup-get-image-data

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 24, 2026

Move the _ImageType type alias and _get_image_data function to a new shared _image_utils module. Both vws.py and query.py previously contained identical definitions. Now both modules import from the shared utility module using local aliases to maintain their existing internal APIs.

This eliminates duplicate code while keeping the public interface unchanged.


Note

Low Risk
Pure refactor to eliminate duplicated helper code; behavior should be unchanged aside from any unintended import/typing edge cases.

Overview
Adds a new shared module vws/_image_utils.py containing ImageType and get_image_data for reading image bytes while preserving file pointer position.

Removes the duplicated _ImageType and _get_image_data definitions from vws.py and query.py, replacing them with imports aliased to the previous internal names to keep call sites unchanged.

Written by Cursor Bugbot for commit 83ef9f1. This will update automatically on new commits. Configure here.

Move _ImageType alias and _get_image_data function to new _image_utils module and import from both vws.py and query.py, eliminating duplicate code.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@adamtheturtle adamtheturtle merged commit 60e5a6e into main Feb 25, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/dedup-get-image-data branch February 25, 2026 06:56
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.

1 participant