[ 
https://issues.apache.org/jira/browse/CAMEL-26209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26209.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/29034 (merged to main as 
d54a633393f93df0144161ea37246405b5115d2c).

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-spring-ai-image - an ImagePrompt body ignores the endpoint options and 
> headers, and an Image with only a URL converts to the URL text
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26209
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26209
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-ai
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of spring-ai-image (CAMEL-24961, PR 
> #28401).
> h4. 1. An ImagePrompt body ignores the endpoint options and headers
> {{SpringAiImageProducer}} (main 2a465aa4814c, lines 51-52) uses an 
> {{ImagePrompt}} body as is; {{buildImageOptions}} is called only for a text 
> body (line 56), so {{n}}, {{width}}, {{height}}, {{model}}, 
> {{responseFormat}} and {{style}} from the endpoint or the headers are 
> ignored. Checked on 4.24.0-SNAPSHOT with a fake {{ImageModel}}.
> Proposed: merge the endpoint/header options into the prompt's options where 
> the prompt leaves them unset.
> h4. 2. An Image with only a URL converts to the URL text as bytes
> {{SpringAiImageConverter.toBytes}} (line 50) returns 
> {{image.getUrl().getBytes()}} when there is no base64 data, and 
> {{toInputStream}} uses it too; a route such as 
> {{.to("spring-ai-image:...").to("file:out?fileName=img.png")}} writes the URL 
> text into the .png. The doc now describes this, but it is still surprising. 
> Checked on 4.24.0-SNAPSHOT with a fake {{ImageModel}}.
> Proposed: fail with a message that suggests {{responseFormat=b64_json}} (or 
> download the URL) instead of returning the URL as image bytes.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to