Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to display picture #13749

Closed
4 tasks done
hfhfn opened this issue Feb 14, 2025 · 3 comments
Closed
4 tasks done

Unable to display picture #13749

hfhfn opened this issue Feb 14, 2025 · 3 comments
Labels
🐞 bug Something isn't working

Comments

@hfhfn
Copy link

hfhfn commented 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.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 14, 2025
Copy link

dosubot bot commented 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

@hfhfn
Copy link
Author

hfhfn commented Feb 14, 2025

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

@crazywoola
Copy link
Member

crazywoola commented Feb 14, 2025

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

For questions please use discussion instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants