GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix ArrayIndexOutOfBoundsException with compact SVG arc notation by hxrshxz · Pull Request #1282 · processing/processing4

Conversation

@hxrshxz

@hxrshxz hxrshxz commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

Fixes #1244

Summary

Adds support for compact SVG arc notation where flags and coordinates are concatenated (e.g., a2 2 0 013 3 instead of a 2 2 0 0 1 3 3). Previously crashed with ArrayIndexOutOfBoundsException.

Changes

  • core/src/processing/core/PShapeSVG.java: Added isCompactArcNotation() helper method to detect and parse concatenated arc flags/coordinates for both A and a commands
  • core/test/processing/core/PShapeSVGPathTest.java: Added 4 test cases covering compact notation, standard notation, and edge cases

Before

Screencast.from.2025-10-15.00-31-18.mp4

After

Screencast.from.2025-10-14.23-14-15.mp4

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hxrshxz
Enhance PShapeSVG to support compact arc notation and add correspondi…
89201ea
…ng unit tests
Copilot AI review requested due to automatic review settings October 14, 2025 19:41
Copilot AI reviewed Oct 14, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an ArrayIndexOutOfBoundsException that occurred when parsing SVG arc commands with compact notation where flags and coordinates are concatenated (e.g., a2 2 0 013 3). The fix adds support for detecting and properly parsing this compact format.

Key changes:

  • Added isCompactArcNotation() helper method to detect concatenated arc flags and coordinates
  • Modified arc parsing logic for both absolute (A) and relative (a) commands to handle compact notation
  • Added comprehensive test coverage for various compact arc notation scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/src/processing/core/PShapeSVG.java Implements compact arc notation detection and parsing logic
core/test/processing/core/PShapeSVGPathTest.java Adds test cases for compact notation, standard notation, and edge cases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/src/processing/core/PShapeSVG.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hxrshxz

hxrshxz commented Oct 14, 2025

Copy link
Copy Markdown
Contributor Author

@catilac have a look :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Stefterv

Stefterv commented Oct 15, 2025

Copy link
Copy Markdown
Member

Hi @hxrshxz great work! Thank you!

Looking at the tests, the one thing I would say to be missing is a step that actually checks if the parsing occurred correctly by looking at the numbers that the parser spits out, I would say just checking if the shape parses is not enough.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hxrshxz
add suggested changes
11ca32b
@hxrshxz

hxrshxz commented Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

Thanks @Stefterv I have added tests to verify the actual parsed endpoint values, not just that the shape doesn't crash

Stefterv reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@catilac
catilac requested a review from Stefterv October 22, 2025 02:49
catilac
catilac reviewed Oct 28, 2025
View reviewed changes

@catilac catilac left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good! I have some questions. Sorry to take so long with this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/src/processing/core/PShapeSVG.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread core/src/processing/core/PShapeSVG.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hxrshxz
add comments
65121fa
@hxrshxz

hxrshxz commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

really sorry for taking so long

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hxrshxz
hxrshxz requested a review from catilac December 16, 2025 19:20
@hxrshxz hxrshxz closed this Dec 27, 2025
@hxrshxz hxrshxz reopened this Dec 27, 2025
@hxrshxz
chore: retrigger CI
a56b91f
catilac
catilac approved these changes Jan 13, 2026
View reviewed changes
@catilac

catilac commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

@hxrshxz this is approved! yay. we are going to do some additional hand testing before it gets merged in. we have an upcoming 4.5 release so i'm being extra careful. but thank you so much! sorry to take so long in accepting this.

villares reacted with hooray emoji hxrshxz and villares reacted with heart emoji villares reacted with rocket emoji
All reactions
  • 🎉 1 reaction
  • ❤️ 2 reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@catilac
catilac merged commit afd1d98 into processing:main Feb 5, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@catilac catilac catilac approved these changes
@Stefterv Stefterv Awaiting requested review from Stefterv

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Loading SVG fails for some files

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hxrshxz @Stefterv @catilac
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.