Extract shared image utilities to reduce duplication#2880
Merged
adamtheturtle merged 1 commit intomainfrom Feb 25, 2026
Merged
Conversation
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>
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.
Move the
_ImageTypetype alias and_get_image_datafunction to a new shared_image_utilsmodule. Bothvws.pyandquery.pypreviously 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.pycontainingImageTypeandget_image_datafor reading image bytes while preserving file pointer position.Removes the duplicated
_ImageTypeand_get_image_datadefinitions fromvws.pyandquery.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.