Skip to content

Parse convert CLI arguments into pipeline steps#4

Open
guilhhotina wants to merge 11 commits into
gly-engine:developfrom
guilhhotina:convert-argv-pipeline
Open

Parse convert CLI arguments into pipeline steps#4
guilhhotina wants to merge 11 commits into
gly-engine:developfrom
guilhhotina:convert-argv-pipeline

Conversation

@guilhhotina

@guilhhotina guilhhotina commented May 8, 2026

Copy link
Copy Markdown

this PR moves the convert CLI away from the hardcoded PNG -> PPM pipeline

the convert frontend now:

  • detects the input format from file bytes, with extension as fallback
  • detects the output format from the output file extension
  • maps supported intermediate CLI tokens into pipeline steps
  • supports -crop as a pipeline filter token
  • parses convert argv into structured tokens before building the pipeline
  • recognizes imagemagick-like source syntax such as -size 512x512 xc:white
  • recognizes -fx "expr" as a filter token, without executing it yet
  • recognizes explicit format prefixes like png:input.bin and ppm:-

generator inputs and -fx are parsed only as command structure for now. the current pipeline still reports them as unsupported because the matching backend workers do not exist yet!

it also update pipeline step creation to report an error when no path exists between steps, instead of silently moving the pipeline into an invalid format

the codec path test was updated to match the current decode flow:

  • BUFFER -> IMG_PNG decodes into IMG_RGBA8
  • IMG_RGBA8 -> IMG_PPM encodes into IMG_PPM

input format detection currently only works with PNG magic bytes, since PNG is the only supported decoded input format in the current pipeline. other formats still fall back to extension-based detection.

@guilhhotina guilhhotina marked this pull request as ready for review May 8, 2026 23:25
Comment thread src/Frontend_Convert/cli.c Outdated
Comment thread src/Frontend_Convert/cli.c Outdated
Comment thread tests/test_convert_tokenize_args.c
Comment thread src/Frontend_Convert/format.c Outdated
Comment thread src/Frontend_Convert/format.c
Comment thread src/Frontend_Convert/format.c Outdated
Comment thread src/Frontend_Convert/cli.c
Comment thread src/Frontend_Convert/tokenize.c Outdated
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.

2 participants