FIR: Filtering By Mime Type

By Sol in Lab

Today, we arrive at the last step to complete the work for the next release of Favicon Rotator— filtering files displayed the media library by mime type.

As I mentioned yesterday, some icons can only support certain file types.  For example, the touch icon must be a PNG file.  Therefore, for the best usability, it is important that we only present images that are compatible with the icon currently being set.

Displaying only PNG Files in media popup

I spent some time tracing the paths of the various media queries to determine where the best point of attack is.  It’s fairly straightforward, but I think I’m going to write a breakdown of the process so that I have a reference for the future, as I am sure to forget it.

So far, it’s properly filtering images when a single file type is allowed (e.g. PNG files for the touch icon).

My next step is to filter by an array of file types.

Which is what I’m about to work on.

Update (15 minutes later): Well, that was faster than expected.  After a quick codeblast, Favicon Rotator now works with single and multiple file type filters.

Now I just need to test, test, test.