+++ /dev/null
-# Magic data for KMimeMagic (originally for file(1) command)
-#
-# Note on adding additional MIME types:
-#
-# [RFC2045,RFC2046] specifies that Content Types, Content Subtypes, Character
-# Sets, Access Types, and conversion values for MIME mail will be assigned and
-# listed by the IANA.
-# http://www.iana.org/assignments/media-types/
-#
-# Any unregistered file type should be listed with a preceding x-, as in
-# application/x-foo (RFC2045 5.1), or a x., as in application/x.foo (RFC4288
-# 4.3). Any non x-prefixed type should be registered with IANA and listed at
-# the above address. Any other behavior is a MIME standards violation!
-#
-# It is preferred that when a registered MIME type exists, that
-# the registered Content-Type and Subtype be used to refer to a file of
-# that type, so don't use application/x-zip when application/zip is
-# registered.
-#
-# If an active RFC suggests that a MIME registration for a new type is in
-# progress, make a note of it pointing to that RFC.
-#
-# The format is 4-5 columns:
-# Column #1: byte number to begin checking from, ">" indicates continuation
-# Column #2: type of data to match
-# Column #3: contents of data to match
-# Column #4: MIME type of result
-# Column #5: MIME encoding of result (optional)
-
-#------------------------------------------------------------------------------
-# Localstuff: file(1) magic for locally observed files
-# Add any locally observed files here.
-
-#------------------------------------------------------------------------------
-# end local stuff
-#------------------------------------------------------------------------------
+++ /dev/null
-#! /usr/bin/env perl
-# -*- PERL -*-
-# $File: magic2mime,v 1.4 2006/11/25 18:36:10 christos Exp $
-# Copyright (c) 1996, 1997 vax@linkdead.paranoia.com (VaX#n8)
-#
-# Usage: echo 'your-file-output-here' | file_to_ctype.pl
-# file -b files... | file_to_ctype.pl
-# It acts like a filter, reading from STDIN and any files on the command
-# line, printing to STDOUT.
-
-## refs
-# http://www.faqs.org/faqs/mail/mime-faq/part1/index.html
-# comp.mail.mime FAQ
-# ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types
-# assigned content-types
-# ftp://ftp.uu.net/inet/rfc/rfc-index
-# RFC index; search for MIME
-
-@mapping =
-(
- # defaults
- 'data', 'application/octet-stream',
- 'text', 'text/plain',
- # more specific
- '^Rich Text Format data', 'text/richtext',
- '^HTML document text', 'text/html',
- '^exported SGML document text', 'text/sgml',
- 'mail text', 'message/rfc822',
- 'news text', 'message/news',
- '^PostScript document text', 'application/postscript',
- '^BinHex binary text', 'application/mac-binhex40',
- '^Zip archive data', 'application/zip',
- '^Microsoft Word', 'application/msword',
- '^PGP key', 'application/pgp-keys',
- '^PGP encrypted', 'application/pgp-encrypted',
- '^PGP armored data signature', 'application/pgp-signature',
- '^JPEG image', 'image/jpeg',
- '^GIF image', 'image/gif',
- '^PNG image', 'image/png',
- '^TIFF image', 'image/tiff',
- 'Computer Graphics Metafile', 'image/cgf',
- '^Sun/NeXT audio data', 'audio/basic',
- '^MPEG', 'video/mpeg',
- '^Apple QuickTime movie', 'video/quicktime',
- '^DICOM medical imaging data', 'application/dicom',
- # made up by me
- '^bitmap', 'image/x-bitmap',
- '^PC bitmap data, Windows 3.x format', 'image/x-msw3bmp',
- '^FLI', 'video/x-fli',
- '^FLC', 'video/x-flc',
- 'AVI data', 'video/x-avi',
- 'WAVE', 'audio/x-wav',
- 'VOC', 'audio/x-voc',
-);
-
-local($mimetype,$index,$regexp);
-while (<>)
- {
- chop;
- $index = $#mapping - 1;
- while ($index > -1 && !defined($mimetype))
- {
- $mimetype = $mapping[$index + 1] if (/$mapping[$index]/);
- $index -= 2;
- }
- print "$mimetype\n";
- undef $mimetype; # hack
- }
-0;