适用于多种应用程序的图标/图像库
我的客户有几个内部 Web 应用程序 - 我们正在重新制作其中一个。 由于不同的应用程序使用不同的图像和图标,IT 经理现在希望我们为此部署一个通用库。
我们有点不确定如何做到这一点。库应该具有编辑者角色,以防止对库进行未经授权的更改,同时可以通过网络(跨国公司)进行访问。
- 我们是否应该将图像托管在我们已有的共享网络应用程序中,例如 Confluence,并在运行时链接它们?
- 我们是否应该像#1 那样托管图像,但在编译时链接它们?
- 其他
我们正在使用 VS2010 和 TFS 顺便说一句。
My customer have several internal web applications - we are remaking one of them.
As the different applications use different images and icons, the IT manager now wants us to deploy a common library for this.
We a bit uncertain on how to do this. The library should have a Editor role to prevent unauthorized changes to the library and at the same time available over the web (global company).
- Should we host the images in a shared webapp we already have, e.g.
Confluence, and link them runtime? - Should we host the images as in #1, but link them in compile time?
- Other
We're using VS2010 and TFS btw.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要在运行时链接,因为您正在谈论可能编辑库(除非您设置某种自动构建过程来在进行任何更改后重建)。在运行时链接图像应该不会太糟糕,因为您正在谈论 Web 应用程序(通常无论如何都会在运行时加载一些资源)。
根据您所讨论的应用程序类型,您可以只拥有一个共享图像文件夹,并为该文件夹中的图像提供预定义的命名方案。例如,有名为“Save20x20.png”、“Open20x20.png”、“Cancel20x20.png”的文件。
然后,您可以创建一个快速的自定义应用程序来查看图像库中的所有图像及其文件名,并根据需要上传新图像。
You will probably need to link at runtime since you are talking about potentially editing the library (unless you set up some kind of automated build process to rebuild after you make any changes). Linking the images at runtime shouldn't be too bad since you are talking about web applications (which typically load some resources at runtime anyway).
Depending on what types of applications you are talking about you could just have a shared Images folder, and have a predefined naming scheme for the images in the folder. For example have files called "Save20x20.png", "Open20x20.png", "Cancel20x20.png".
You could then make a quick custom app to view all the images in your image library and their file names, and upload new images as required.
我曾经做过类似的事情(http://www.parti.cl,它提供图标作为服务),它使用采用以下方法:
您可以将图像存储为二进制数据库 blob(非常适合小图像和基于 URL 动态生成的图像)或文件系统。但是,一旦您开始执行诸如使用数据库存储引用者之类的操作,最简单的方法就是动态返回图像(即,您有一些代码可以将图像从任何位置复制到 HTTP 响应对象中),而不是依赖静态服务器。
最后,尽可能使用缓存来减少负载(HTTP 缓存和应用程序内的负载),但要小心正确处理缓存验证请求,以便当图像更改时新图像会快速传播。
PS 请记住,如果图像需要包含在安全站点中,您还需要支持 SSL。
I have worked on something similar (http://www.parti.cl which provides icons as a service) which used the following approach:
src
attribute for images.You can store the images as binary database blobs (works nicely for small images and for images that are dynamically generated based on the URL) or on the file system. But once you start doing things like using the database to store referrers it's easiest to return the image dynamically (ie you have some code that copies the image from wherever it is into an HTTP response object) rather than relying on a static server.
Finally, use caching where possible to reduce load (both HTTP cache and within your application), but be careful to handle cache validation requests correctly so that when an image changes the new one propagates quickly.
PS Remember that you will need to support SSL too, if images need to be included in secure sites.