Skip to content

fix: correct base64 data URI segment count validation in readImage#809

Closed
ionkorol wants to merge 1 commit intosoftware-mansion:mainfrom
KorSoftwareSolutions:fix_base64_read_img
Closed

fix: correct base64 data URI segment count validation in readImage#809
ionkorol wants to merge 1 commit intosoftware-mansion:mainfrom
KorSoftwareSolutions:fix_base64_read_img

Conversation

@ionkorol
Copy link

Description

A base64 data URI (e.g. data:image/png;base64,iVBOR...) splits into 2 segments by ,, but the check was comparing against 1, causing all valid base64 image inputs to be rejected.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

  • Pass a base64-encoded image data URI to a model that calls readImage and verify it is decoded and processed correctly
  • Verify that malformed URIs (no comma, multiple commas) are still correctly rejected

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@msluszniak
Copy link
Member

Thank you @ionkorol for your PR, this totally makes sense. I'll test this change tommorow and probably add some test cases to our test suite :)

@msluszniak msluszniak self-requested a review February 16, 2026 09:44
@msluszniak msluszniak self-assigned this Feb 16, 2026
@msluszniak msluszniak added the bug fix PRs that are fixing bugs label Feb 16, 2026
@msluszniak
Copy link
Member

@ionkorol I'm closing this one in favour of #811 as I couldn't make changes to the PR that comes from organisation.

@msluszniak msluszniak closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants