如何使用 Tapestry 5 将图像作为文件上传并将其显示为缩略图?

发布于 2024-08-11 02:35:07 字数 133 浏览 1 评论 0原文

使用第 3 方 Tapestry-upload 组件,我可以从客户端上传文件到服务器上。

使用 chenillekit 的缩略图组件,可以从资源中制作缩略图。

如何将我的文件转换为资产,以便缩略图组件为我提供图像缩略图?

Using the 3rd party tapestry-upload component, I can upload a File from the client on the server.

Using the chenillekit's thumbnail component, a can make a thumbnail from an Asset.

How can I convert my File into an Asset in order for the Thumbnail component to provide me the image thumbnail ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

轻许诺言 2024-08-18 02:35:07

邮件列表上有一些讨论此问题的线程。基本上,您需要提供一个自定义 AssetFactory 来从磁盘(或数据库)读取图像。您还可以查看 URIAssetFactory,它是 ChenilleKit 本身的一部分。

以下是一些可以提供帮助的链接:

https://issues.apache.org/jira/浏览/TAP5-423

http://www .mail-archive.com/[电子邮件受保护]/msg33692.html

There are a few threads on the mailing list that deal with this. Basically, you need to contribute a custom AssetFactory that reads the image from disk (or the database). You might also look at URIAssetFactory which is part of ChenilleKit itself.

Here are a few links to help:

https://issues.apache.org/jira/browse/TAP5-423

http://www.mail-archive.com/[email protected]/msg33692.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文