Added support for transcoding from the PPM image format

This commit is contained in:
Matthew Barbour 2020-10-26 07:25:47 -05:00
parent cb81e46f9e
commit df93e2e5d5
5 changed files with 12 additions and 0 deletions

View file

@ -55,6 +55,7 @@ abstract class MediaEngine
MimeType::GIF,
MimeType::JPEG,
MimeType::PNG,
MimeType::PPM,
MimeType::PSD,
MimeType::TIFF,
MimeType::WEBP,

View file

@ -46,6 +46,7 @@ class FileExtension
public const PHP5 = 'php5';
public const PNG = 'png';
public const PSD = 'psd';
public const PPM = 'ppm';
public const MOV = 'mov';
public const RSS = 'rss';
public const SVG = 'svg';

View file

@ -144,6 +144,11 @@ class MimeMap
self::MAP_EXT => [FileExtension::PNG],
self::MAP_MIME => [MimeType::PNG],
],
MimeType::PPM => [
self::MAP_NAME => "Portable Pixel Map",
self::MAP_EXT => [FileExtension::PPM],
self::MAP_MIME => [MimeType::PPM],
],
MimeType::PSD => [
self::MAP_NAME => "PSD",
self::MAP_EXT => [FileExtension::PSD],

View file

@ -38,6 +38,7 @@ class MimeType
public const PDF = 'application/pdf';
public const PHP = 'text/x-php';
public const PNG = 'image/png';
public const PPM = 'image/x-portable-pixmap';
public const PSD = 'image/vnd.adobe.photoshop';
public const QUICKTIME = 'video/quicktime';
public const RSS = 'application/rss+xml';
@ -242,6 +243,9 @@ class MimeType
case FileExtension::ANI:
$output = MimeType::ANI;
break;
case FileExtension::PPM:
$output = MimeType::PPM;
break;
// TODO: There is no uniquely defined Mime type for the cursor format. Need to figure this out.
// case FileExtension::CUR:
// $output = MimeType::CUR;

View file

@ -22,6 +22,7 @@ class TranscodeImage extends Extension
"ICO" => MimeType::ICO,
"JPG" => MimeType::JPEG,
"PNG" => MimeType::PNG,
"PPM" => MimeType::PPM,
"PSD" => MimeType::PSD,
"TIFF" => MimeType::TIFF,
"WEBP" => MimeType::WEBP