如何显示使用md5散列值在Web根外部保存的图像?

I have a series of images I wish to display on a site using the HTML img tag.

e.g. <img src='some/location' />

However the image is located in a different directory outside of the web root. (but still on same server).

Moreover it has been saved as a hashed value using php's md5_file()

How do I go about displaying the image on the site, even if I can get to the file somehow, it has been saved differently?

You have to do something like <img src="image.php?img=whatever">. Your image.php file will need to grab the image outside of the web root, as well as decode it for viewing.

You can force a .jpg (or whatever) extension using URL rewrites.