drop php7.3 support, make use of 7.4 features
This commit is contained in:
@ -4,12 +4,12 @@ class TranscodeImageInfo extends ExtensionInfo
|
||||
{
|
||||
public const KEY = "transcode";
|
||||
|
||||
public $key = self::KEY;
|
||||
public $name = "Transcode Image";
|
||||
public $authors = ["Matthew Barbour"=>"matthew@darkholme.net"];
|
||||
public $license = self::LICENSE_WTFPL;
|
||||
public $description = "Allows admins to automatically and manually transcode images.";
|
||||
public $documentation =
|
||||
public string $key = self::KEY;
|
||||
public string $name = "Transcode Image";
|
||||
public array $authors = ["Matthew Barbour"=>"matthew@darkholme.net"];
|
||||
public string $license = self::LICENSE_WTFPL;
|
||||
public string $description = "Allows admins to automatically and manually transcode images.";
|
||||
public ?string $documentation =
|
||||
"Can transcode on-demand and automatically on upload. Config screen allows choosing an output format for each of the supported input formats.
|
||||
Supports GD and ImageMagick. Both support bmp, gif, jpg, png, and webp as inputs, and jpg, png, and lossy webp as outputs.
|
||||
ImageMagick additionally supports tiff and psd inputs, and webp lossless output.
|
||||
|
@ -12,7 +12,7 @@ class ImageTranscodeException extends SCoreException
|
||||
class TranscodeImage extends Extension
|
||||
{
|
||||
/** @var TranscodeImageTheme */
|
||||
protected $theme;
|
||||
protected ?Themelet $theme;
|
||||
|
||||
const ACTION_BULK_TRANSCODE = "bulk_transcode";
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
function transcodeSubmit(e) {
|
||||
var mime = document.getElementById('transcode_mime').value;
|
||||
if(!mime.includes("lossless=true") && format != "image/png") {
|
||||
if(!mime.includes("lossless=true") && format !== "image/png") {
|
||||
var lossless = document.getElementById('image_lossless');
|
||||
if(lossless!=null && lossless.value=='1') {
|
||||
if(lossless!=null && lossless.value==='1') {
|
||||
return confirm('You are about to transcode from a lossless format to a lossy format. Lossless formats compress with no quality loss, but converting to a lossy format always results in quality loss, and it will lose more quality every time it is done again on the same image. Are you sure you want to perform this transcode?');
|
||||
} else {
|
||||
return confirm('Converting to a lossy format always results in quality loss, and it will lose more quality every time it is done again on the same image. Are you sure you want to perform this transcode?');
|
||||
|
@ -5,7 +5,7 @@ class TranscodeImageTheme extends Themelet
|
||||
/*
|
||||
* Display a link to resize an image
|
||||
*/
|
||||
public function get_transcode_html(Image $image, array $options)
|
||||
public function get_transcode_html(Image $image, array $options): string
|
||||
{
|
||||
$html = "
|
||||
".make_form(
|
||||
@ -25,7 +25,7 @@ class TranscodeImageTheme extends Themelet
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function get_transcode_picker_html(array $options)
|
||||
public function get_transcode_picker_html(array $options): string
|
||||
{
|
||||
$html = "<select id='transcode_mime' name='transcode_mime' required='required' >";
|
||||
foreach ($options as $display=>$value) {
|
||||
@ -35,7 +35,7 @@ class TranscodeImageTheme extends Themelet
|
||||
return $html."</select>";
|
||||
}
|
||||
|
||||
public function display_transcode_error(Page $page, string $title, string $message)
|
||||
public function display_transcode_error(Page $page, string $title, string $message): void
|
||||
{
|
||||
$page->set_title("Transcode Image");
|
||||
$page->set_heading("Transcode Image");
|
||||
|
Reference in New Issue
Block a user