适用于多种应用程序的图标/图像库

发布于 2024-12-01 03:59:02 字数 310 浏览 2 评论 0原文

我的客户有几个内部 Web 应用程序 - 我们正在重新制作其中一个。 由于不同的应用程序使用不同的图像和图标,IT 经理现在希望我们为此部署一个通用库。

我们有点不确定如何做到这一点。库应该具有编辑者角色,以防止对库进行未经授权的更改,同时可以通过网络(跨国公司)进行访问。

  1. 我们是否应该将图像托管在我们已有的共享网络应用程序中,例如 Confluence,并在运行时链接它们?
  2. 我们是否应该像#1 那样托管图像,但在编译时链接它们?
  3. 其他

我们正在使用 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).

  1. Should we host the images in a shared webapp we already have, e.g.
    Confluence, and link them runtime?
  2. Should we host the images as in #1, but link them in compile time?
  3. Other

We're using VS2010 and TFS btw.

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

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

发布评论

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

评论(2

彼岸花ソ最美的依靠 2024-12-08 03:59:02

您可能需要在运行时链接,因为您正在谈论可能编辑库(除非您设置某种自动构建过程来在进行任何更改后重建)。在运行时链接图像应该不会太糟糕,因为您正在谈论 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.

请止步禁区 2024-12-08 03:59:02

我曾经做过类似的事情(http://www.parti.cl,它提供图标作为服务),它使用采用以下方法:

  • 一个单独的图像服务,其工作只是提供图像
  • ,图像由 URL 路径标识,
  • 其他服务然后生成 HTML,其中包含适当的路径作为图像的 src 属性。
  • 如果这很重要的话,路径可以包含用于引用者过滤的信息(例如,如果您想要向多个站点提供图像,那么您将拥有一些在这些站点之间具有一对多关系的表图像 ID/名称以及可以请求它的站点)。
  • 该路径还可以包括版本控制信息。例如,您可以使用类似 http://images.example.com/short-name/ 的方案version 其中“短名称”标识图像,“版本”允许您管理多个版本。

您可以将图像存储为二进制数据库 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:

  • a separate image service, whose job is only to provide images
  • images are identified by the URL path
  • other services then generate HTML that includes the appropriate path as the src attribute for images.
  • the path can include information that is used for referrer filtering, if that is important (so, for example, if have multiple sites that you want to provide images to, then you would have some table that has a one-to-many relation between the image ID/name and the sites that can request it).
  • the path can also include versioning information. For example you might use a scheme something like http://images.example.com/short-name/version where "short-name" identifies the image and "version" allows you to have manage multiple versions.

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.

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