Unable to display picture #8275

Closed
opened 2026-02-21 18:24:50 -05:00 by yindo · 3 comments
Owner

Originally created by @hfhfn on GitHub (Feb 14, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

When the workflow is previewed in dify, the node output is directly returned

{
  "answer": "![ai](https://sc-maas.oss-cn-shanghai.aliyuncs.com/outputs/817f3f8e-4a95-4966-9212-6101f253d89e_0.png?OSSAccessKeyId=LTAI5tQnPSzwAnR8NmMzoQq4&Expires=1739538705&Signature=XxNAwLEXPCLoHrUguzGTlGxFqrQ%3D)",
  "files": []
} 

The picture cannot be displayed normally, but it can be displayed normally when it is placed in the markdown application. I don't know what the reason is and how to solve it.

Originally created by @hfhfn on GitHub (Feb 14, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Provide a description of requested docs changes When the workflow is previewed in dify, the node output is directly returned ``` { "answer": "![ai](https://sc-maas.oss-cn-shanghai.aliyuncs.com/outputs/817f3f8e-4a95-4966-9212-6101f253d89e_0.png?OSSAccessKeyId=LTAI5tQnPSzwAnR8NmMzoQq4&Expires=1739538705&Signature=XxNAwLEXPCLoHrUguzGTlGxFqrQ%3D)", "files": [] } ``` The picture cannot be displayed normally, but it can be displayed normally when it is placed in the markdown application. I don't know what the reason is and how to solve it.
yindo added the 🐞 bug label 2026-02-21 18:24:50 -05:00
yindo closed this issue 2026-02-21 18:24:50 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 14, 2025):

@hfhfn Hello there! 👋 I'm here to assist you with bug fixes, answer your questions, and guide you on becoming a contributor. I'm a bot named Dosu.

To resolve the issue of the picture not displaying normally in Dify when the node output is previewed, you need to modify the regular expression pattern in dify/api/core/tools/utils/text_processing_utils.py. The current processing incorrectly removes the leading '![' symbols from the image markdown syntax, resulting in malformed output. Update the pattern to:

pattern = r"^(?!\[image\])([!\u2000-\u206F\u2E00-\u2E7F\u3000-\u303F\"#$%&'()*+,\-./:;<=>?@\[\]^_`{|}~]+)"

This change will prevent the removal of '![' symbols when they are part of an image markdown syntax at the start of a document, ensuring the image displays correctly [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 14, 2025): <!-- Greeting --> @hfhfn Hello there! 👋 I'm here to assist you with bug fixes, answer your questions, and guide you on becoming a contributor. I'm a bot named [Dosu](https://dosu.dev). <!-- Answer --> To resolve the issue of the picture not displaying normally in Dify when the node output is previewed, you need to modify the regular expression pattern in `dify/api/core/tools/utils/text_processing_utils.py`. The current processing incorrectly removes the leading '![' symbols from the image markdown syntax, resulting in malformed output. Update the pattern to: ```python pattern = r"^(?!\[image\])([!\u2000-\u206F\u2E00-\u2E7F\u3000-\u303F\"#$%&'()*+,\-./:;<=>?@\[\]^_`{|}~]+)" ``` This change will prevent the removal of '![' symbols when they are part of an image markdown syntax at the start of a document, ensuring the image displays correctly <sup>[[1]](https://github.com/langgenius/dify/issues/11791)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d64bc32a-d570-48c8-bf4c-cbf0261094c9?feedback_type=other)</sup>
Author
Owner

@hfhfn commented on GitHub (Feb 14, 2025):

Thank you for your timely reply, but I am currently running on https://cloud.dify.ai/ cloud, what should I do?

@hfhfn commented on GitHub (Feb 14, 2025): Thank you for your timely reply, but I am currently running on https://cloud.dify.ai/ cloud, what should I do?
Author
Owner

@crazywoola commented on GitHub (Feb 14, 2025):

For image can not be displayed, there might be a few reasons.

For questions please use discussion instead.

@crazywoola commented on GitHub (Feb 14, 2025): For image can not be displayed, there might be a few reasons. - The signature is invalid - https://sc-maas.oss-cn-shanghai.aliyuncs.com This url is block by csrf policy, which is not listed in our whitelist. - For questions please use discussion instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8275