2020-08-04 11:25:22 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-08-04 11:25:22 +00:00
|
|
|
namespace Config;
|
2020-05-27 18:46:16 +02:00
|
|
|
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
2021-04-02 17:20:02 +00:00
|
|
|
use CodeIgniter\Images\Handlers\GDHandler;
|
|
|
|
use CodeIgniter\Images\Handlers\ImageMagickHandler;
|
2020-05-27 18:46:16 +02:00
|
|
|
|
|
|
|
class Images extends BaseConfig
|
|
|
|
{
|
2020-06-10 15:00:12 +00:00
|
|
|
/**
|
|
|
|
* Default handler used if no other handler is specified.
|
|
|
|
*/
|
2021-05-18 17:16:36 +00:00
|
|
|
public string $defaultHandler = 'gd';
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
/**
|
2021-05-19 16:35:13 +00:00
|
|
|
* The path to the image library. Required for ImageMagick, GraphicsMagick, or NetPBM.
|
2020-06-10 15:00:12 +00:00
|
|
|
*/
|
2021-05-18 17:16:36 +00:00
|
|
|
public string $libraryPath = '/usr/local/bin/convert';
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
/**
|
|
|
|
* The available handler classes.
|
|
|
|
*
|
2021-04-02 17:20:02 +00:00
|
|
|
* @var array<string, string>
|
2020-06-10 15:00:12 +00:00
|
|
|
*/
|
2021-05-18 17:16:36 +00:00
|
|
|
public array $handlers = [
|
2023-06-12 14:47:38 +00:00
|
|
|
'gd' => GDHandler::class,
|
2021-04-02 17:20:02 +00:00
|
|
|
'imagick' => ImageMagickHandler::class,
|
2020-06-10 15:00:12 +00:00
|
|
|
];
|
2020-09-08 11:45:17 +00:00
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
/*
|
2021-05-19 16:35:13 +00:00
|
|
|
|--------------------------------------------------------------------------
|
2021-11-01 17:12:03 +00:00
|
|
|
| Uploaded images sizes (in px)
|
2021-04-02 17:20:02 +00:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| The sizes listed below determine the resizing of images when uploaded.
|
2021-05-19 16:35:13 +00:00
|
|
|
*/
|
2020-09-08 11:45:17 +00:00
|
|
|
|
|
|
|
/**
|
2021-11-01 17:12:03 +00:00
|
|
|
* Podcast cover image sizes
|
|
|
|
*
|
|
|
|
* Uploaded podcast covers are of 1:1 ratio (width and height are the same).
|
|
|
|
*
|
|
|
|
* Size of images linked in the rss feed (should be between 1400 and 3000). Size for ID3 tag cover art (should be
|
|
|
|
* between 300 and 800)
|
|
|
|
*
|
|
|
|
* Array values are as follows: 'name' => [width, height]
|
|
|
|
*
|
2021-11-23 11:54:34 +00:00
|
|
|
* @var array<string, array<string, int|string>>
|
2020-09-08 11:45:17 +00:00
|
|
|
*/
|
2021-11-01 17:12:03 +00:00
|
|
|
public array $podcastCoverSizes = [
|
2021-11-23 11:54:34 +00:00
|
|
|
'tiny' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 40,
|
|
|
|
'height' => 40,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'thumbnail' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 150,
|
|
|
|
'height' => 150,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'medium' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 320,
|
|
|
|
'height' => 320,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'large' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 1024,
|
|
|
|
'height' => 1024,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'feed' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 1400,
|
2021-11-23 11:54:34 +00:00
|
|
|
'height' => 1400,
|
|
|
|
],
|
|
|
|
'id3' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 500,
|
2021-11-23 11:54:34 +00:00
|
|
|
'height' => 500,
|
|
|
|
],
|
2022-01-23 12:14:15 +00:00
|
|
|
'og' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 1200,
|
2022-01-23 12:14:15 +00:00
|
|
|
'height' => 1200,
|
|
|
|
],
|
2021-11-23 11:54:34 +00:00
|
|
|
'federation' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 400,
|
2021-11-23 11:54:34 +00:00
|
|
|
'height' => 400,
|
|
|
|
],
|
|
|
|
'webmanifest192' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 192,
|
|
|
|
'height' => 192,
|
|
|
|
'mimetype' => 'image/png',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'png',
|
|
|
|
],
|
|
|
|
'webmanifest512' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 512,
|
|
|
|
'height' => 512,
|
|
|
|
'mimetype' => 'image/png',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'png',
|
|
|
|
],
|
2021-11-01 17:12:03 +00:00
|
|
|
];
|
2020-09-08 11:45:17 +00:00
|
|
|
|
|
|
|
/**
|
2021-11-01 17:12:03 +00:00
|
|
|
* Podcast header cover image
|
|
|
|
*
|
|
|
|
* Uploaded podcast header covers are of 3:1 ratio
|
|
|
|
*
|
2021-11-23 11:54:34 +00:00
|
|
|
* @var array<string, array<string, int|string>>
|
2020-09-08 11:45:17 +00:00
|
|
|
*/
|
2021-11-01 17:12:03 +00:00
|
|
|
public array $podcastBannerSizes = [
|
2021-11-23 11:54:34 +00:00
|
|
|
'small' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 320,
|
|
|
|
'height' => 128,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'medium' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 960,
|
|
|
|
'height' => 320,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'federation' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 1500,
|
2021-11-23 11:54:34 +00:00
|
|
|
'height' => 500,
|
|
|
|
],
|
2021-11-01 17:12:03 +00:00
|
|
|
];
|
2020-09-08 11:45:17 +00:00
|
|
|
|
2022-01-20 14:51:31 +00:00
|
|
|
public string $avatarDefaultPath = 'castopod-avatar.jpg';
|
2021-12-20 17:12:12 +00:00
|
|
|
|
|
|
|
public string $avatarDefaultMimeType = 'image/jpg';
|
|
|
|
|
2022-01-20 14:51:31 +00:00
|
|
|
/**
|
|
|
|
* @var array<string, array<string, string>>
|
|
|
|
*/
|
|
|
|
public array $podcastBannerDefaultPaths = [
|
|
|
|
'default' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-pine.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'pine' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-pine.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'crimson' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-crimson.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'amber' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-amber.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'lake' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-lake.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'jacaranda' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-jacaranda.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
'onyx' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'path' => 'castopod-banner-onyx.jpg',
|
2022-01-20 14:51:31 +00:00
|
|
|
'mimetype' => 'image/jpeg',
|
|
|
|
],
|
|
|
|
];
|
2020-09-08 11:45:17 +00:00
|
|
|
|
2021-11-01 17:12:03 +00:00
|
|
|
public string $podcastBannerDefaultMimeType = 'image/jpeg';
|
2020-09-08 11:45:17 +00:00
|
|
|
|
2021-11-01 17:12:03 +00:00
|
|
|
/**
|
|
|
|
* Person image
|
|
|
|
*
|
|
|
|
* Uploaded person images are of 1:1 ratio (width and height are the same).
|
|
|
|
*
|
|
|
|
* Array values are as follows: 'name' => [width, height]
|
|
|
|
*
|
2021-11-23 11:54:34 +00:00
|
|
|
* @var array<string, array<string, int|string>>
|
2021-11-01 17:12:03 +00:00
|
|
|
*/
|
|
|
|
public array $personAvatarSizes = [
|
2022-01-20 14:51:31 +00:00
|
|
|
'federation' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 400,
|
2022-01-20 14:51:31 +00:00
|
|
|
'height' => 400,
|
|
|
|
],
|
2021-11-23 11:54:34 +00:00
|
|
|
'tiny' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 40,
|
|
|
|
'height' => 40,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'thumbnail' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 150,
|
|
|
|
'height' => 150,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
|
|
|
'medium' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'width' => 320,
|
|
|
|
'height' => 320,
|
|
|
|
'mimetype' => 'image/webp',
|
2021-11-23 11:54:34 +00:00
|
|
|
'extension' => 'webp',
|
|
|
|
],
|
2021-11-01 17:12:03 +00:00
|
|
|
];
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|