I have a PHP script running that lists files in a certain directory on the server. Is there any way to access the file's icon metadata? Lots of issues with this I suppose (eg: depends on the OS hosting the script. depends on whether the file is using a custom icon. still have to convert the icn file to something that can be displayed in a browser) but any suggestions are welcome. I guess I could display a different icon depending on the file extension, but it would be nice to do it automatically.
['https://Stackoverflow.com/questions/976120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4939/']
You might be able to plug into the /icons folder that most apache installations have setup for their default directory listings. 

It's not OS dependent at least.

You should be able to craft a url that displays an icon for a particular extension.
[GDLib](http://php.oregonstate.edu/manual/en/book.image.php) or [ImageMagic](http://php.oregonstate.edu/manual/en/book.imagick.php) possibly is that what you are looking for... But if you want to access metadata GDLib won't help. Not sure about ImageMagic. 

Actually, you can create thumbnails with their help and cache them somewhere to avoid performance issues.