https://github.com/splitbrain/file-icon-generator
Generate consistent pixel perfect file icons
https://github.com/splitbrain/file-icon-generator
icons php png
Last synced: 7 months ago
JSON representation
Generate consistent pixel perfect file icons
- Host: GitHub
- URL: https://github.com/splitbrain/file-icon-generator
- Owner: splitbrain
- Created: 2014-02-16T16:10:27.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-06T23:53:44.000Z (almost 12 years ago)
- Last Synced: 2025-04-15T19:49:18.918Z (11 months ago)
- Topics: icons, php, png
- Language: PHP
- Size: 262 KB
- Stars: 38
- Watchers: 5
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
File Icon Generator
===================
This class can build pixel-perfect file type icons based on a extension name
and its associated mime type.
Icons are build based on a template file on which then a colored label with
the extension is printed. This makes it easy to create a consistent look in
your application without the problem of missing the icon for a certain file
type.
Currently 16x16 and 32x32 images can be generated.

Usage
-----
See createall.php for building all icons at once, otherwise just refer to the
source code comments. It's relatively straight forward.
MIME matching
-------------
Color and template files are first matched against a ```extension-```
entry. If that is not found the mime type is matched.
For matching mime types in color and template setup the mime type of an extension
is broken up parts at the charcters ```/```, ```.``` and ```-``` and connected
with a ```-``` again.
Partial matches are then tried per segment. Example:
```application/vnd.openxmlformats-officedocument.wordprocessingml.document``` becomes
```application-vnd-openxmlformats-officedocument-wordprocessingml-document```. It
could be matched with ```application-vnd-openxmlformats``` or ```application```. The
longest match wins. Note: ```wordprocessingml``` would not match!
Todo
----
This can be improved, pull requests more than welcome!
* define more colors
* create more templates for common formats
* add more output sizes