Which component is this issue related to?
Umbraco.AI (Core)
Which Umbraco AI version are you using? (Please write the exact version, example: 10.1.0)
17.2.2
Bug summary
When using {{image:umbracoFile}} in a prompt template, the original image file is sent to the AI provider with no resizing or compression. For any reasonably sized upload from a modern camera/phone, this exceeds provider limits.
Example error from Claude (Anthropic provider):
Status Code: BadRequest
{"type":"error","error":{"type":"invalid_request_error",
"message":"messages.0.content.1.image.source.base64: image exceeds 5 MB maximum: 8393108 bytes > 5242880 bytes"}}
The media in question had multiple image crops defined (thumbnail, content variants, social) — all well under 5MB — but the original 8MB file was sent regardless.
Specifics
No response
Steps to reproduce
Testing undocumented crop syntax in the template variable:
{{image:umbracoFile:content3Col}} — template resolves to empty, no image sent
{{image:umbracoFile.content3Col}} — same
{{image:umbracoFile,content3Col}} — same
Confirmed via source: ImageTemplateVariableProcessor passes everything after image: as a single property alias to entity.GetValue(), and AIUmbracoMediaResolver reads raw bytes from the filesystem with no transformation. There's no hook for crop selection or resize.
Expected result / actual result
Crop parameter in the variable syntax — e.g. {{image:umbracoFile:content6Col}} resolves to the named crop URL and fetches that
Config-level max dimensions / file size — provider-aware default (Claude 5MB, OpenAI different) with automatic downscale via ImageSharp before sending
Both — explicit crop when editor wants control, auto-resize as a safety net
Happy to contribute a PR if you'd like — let me know the approach you'd prefer.
Dependencies
Umbraco 17.2.2
Umbraco.AI 1.7.0, Umbraco.AI.Prompt 1.6.0, Umbraco.AI.Anthropic 1.2.2
Note 1: I should also add the of course there is no need to upload such large images in the first place but this would reduce the overall size images going to AI for simple things such as alternative text.
Note 2: this also to go one step towards creating alternative text for images where there are crops as it could describe the different crops and provide alternative text for each where only a part of the image is now showing For example the original image may be a dog and a cat but each of the crops only show only the dog or only the cat and therefore be described as such
Which component is this issue related to?
Umbraco.AI (Core)
Which Umbraco AI version are you using? (Please write the exact version, example: 10.1.0)
17.2.2
Bug summary
When using {{image:umbracoFile}} in a prompt template, the original image file is sent to the AI provider with no resizing or compression. For any reasonably sized upload from a modern camera/phone, this exceeds provider limits.
Example error from Claude (Anthropic provider):
The media in question had multiple image crops defined (thumbnail, content variants, social) — all well under 5MB — but the original 8MB file was sent regardless.
Specifics
No response
Steps to reproduce
Testing undocumented crop syntax in the template variable:
{{image:umbracoFile:content3Col}} — template resolves to empty, no image sent
{{image:umbracoFile.content3Col}} — same
{{image:umbracoFile,content3Col}} — same
Confirmed via source: ImageTemplateVariableProcessor passes everything after image: as a single property alias to entity.GetValue(), and AIUmbracoMediaResolver reads raw bytes from the filesystem with no transformation. There's no hook for crop selection or resize.
Expected result / actual result
Crop parameter in the variable syntax — e.g. {{image:umbracoFile:content6Col}} resolves to the named crop URL and fetches that
Config-level max dimensions / file size — provider-aware default (Claude 5MB, OpenAI different) with automatic downscale via ImageSharp before sending
Both — explicit crop when editor wants control, auto-resize as a safety net
Happy to contribute a PR if you'd like — let me know the approach you'd prefer.
Dependencies
Umbraco 17.2.2
Umbraco.AI 1.7.0, Umbraco.AI.Prompt 1.6.0, Umbraco.AI.Anthropic 1.2.2
Note 1: I should also add the of course there is no need to upload such large images in the first place but this would reduce the overall size images going to AI for simple things such as alternative text.
Note 2: this also to go one step towards creating alternative text for images where there are crops as it could describe the different crops and provide alternative text for each where only a part of the image is now showing For example the original image may be a dog and a cat but each of the crops only show only the dog or only the cat and therefore be described as such