Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6c15d00c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| DecodeJPEG(fileBytes, out int width, out int height); | ||
| return (width, height); |
There was a problem hiding this comment.
Parse JPEG headers instead of full decode for dimensions
Gemma3ImageProcessor.ReadImageDimensions now calls DecodeJPEG just to read width/height, which allocates a full RGBA buffer for every JPEG (width * height * 4) and then throws it away. This path is used during token-count expansion before inference (e.g., ModelService loops all msg.ImagePaths), so large or multiple JPEG inputs now incur an extra full decode and substantial transient memory pressure compared with the previous header-only PNG path, increasing latency and OOM risk for multimodal requests.
Useful? React with 👍 / 👎.
No description provided.