views:

125

answers:

3

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.

A: 

GDLib or ImageMagic 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.

Jet
A: 

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.

Allain Lalonde
A: 

If you want to extract IPTC information from file you can use getimagesize function fith extra parameter.

Nazariy