This commit is contained in:
Ralf Becker 2015-01-11 13:04:06 +00:00
parent baf79766a6
commit 5b2baa7f44
70 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,68 @@
#!/usr/bin/php
<?php
/**
* EGroupWare: Convert eagerterrier mime icons
*
* @link https://github.com/eagerterrier/MimeTypes-Link-Icons
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2015 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @version $Id$
*/
require_once '../../../../phpgwapi/inc/class.mime_magic.inc.php';
/* compare current Horde $mime_extension_map with ours
include_once 'Horde/Mime/mime.mapping.php';
foreach($mime_extension_map as $ext => $type)
{
if (!isset(mime_magic::$mime_extension_map[$ext]))
{
echo "+\t$ext\t$type\n";
}
elseif(strtolower($type) === strtolower(mime_magic::$mime_extension_map[$ext]))
{
echo "\t$ext\t$type\n";
}
else
{
echo "-\t$ext\t".mime_magic::$mime_extension_map[$ext]."\n";
echo "+\t$ext\t$type\n";
}
}
exit;
*/
// make sure these mime-type get their default extensions icon, not some alias
$overwrites = array(
'txt' => 'text/plain',
'ogg' => 'audio/ogg',
'ppt' => 'application/vnd.ms-powerpoint',
'qt' => 'video/quicktime',
);
$src_dir=__DIR__.'/MimeTypes-Link-Icons/images';
$dst_dir=__DIR__;
foreach(scandir($src_dir) as $file)
{
if (preg_match('/^([^-]+)-icon-128x128.png$/', $file, $matches))
{
if (!isset(mime_magic::$mime_extension_map[$matches[1]]))
{
echo "Unknown extension '$matches[1]'!\n";
continue;
}
$type = mime_magic::$mime_extension_map[$matches[1]];
$dst_file = 'mime128_'.str_replace('/', '_', $type).'.png';
if (file_exists($dst_dir.'/'.$dst_file) && !isset($overwrites[$matches[1]]))
{
echo "Icon for extension '$matches[1]' = $type already exists!\n";
continue;
}
copy($src_dir.'/'.$file, $dst_dir.'/'.$dst_file);
echo "$file --> $dst_file\n";
}
//else echo "Ignoring $file\n";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB