forked from leftypol/leftypol
FallbackMediaHandler.php: update
This commit is contained in:
parent
c3f7ed1475
commit
020ab7d4fc
1 changed files with 5 additions and 9 deletions
|
@ -51,23 +51,20 @@ class FallbackMediaHandler implements MediaHandler {
|
||||||
|
|
||||||
public function installMediaAndGenerateThumb(
|
public function installMediaAndGenerateThumb(
|
||||||
mixed $handle,
|
mixed $handle,
|
||||||
string $media_preferred_out_file_dir,
|
string $media_preferred_out_file_basepath,
|
||||||
string $media_preferred_out_file_name,
|
string $thumb_preferred_out_file_basepath,
|
||||||
string $thumb_preferred_out_file_dir,
|
|
||||||
string $thumb_preferred_out_file_name,
|
|
||||||
string $thumb_preferred_out_mime,
|
string $thumb_preferred_out_mime,
|
||||||
int $thumb_max_width,
|
int $thumb_max_width,
|
||||||
int $thumb_max_height
|
int $thumb_max_height
|
||||||
): MediaInstallResult {
|
): MediaInstallResult {
|
||||||
list($source_file_path, $source_file_mime, $source_file_kind) = $handle;
|
list($source_file_path, $source_file_mime, $source_file_kind) = $handle;
|
||||||
$out_path = $media_preferred_out_file_dir . DIRECTORY_SEPARATOR . $media_preferred_out_file_name . '.' . Metadata\mime_to_ext($source_file_mime);
|
$out_path = $media_preferred_out_file_basepath . '.' . Metadata\mime_to_ext($source_file_mime);
|
||||||
|
|
||||||
$this->move_or_link_or_copy($source_file_kind, $source_file_path, $out_path);
|
$this->move_or_link_or_copy($source_file_kind, $source_file_path, $out_path);
|
||||||
|
|
||||||
$thumb = $this->generateThumb(
|
$thumb = $this->generateThumb(
|
||||||
$handle,
|
$handle,
|
||||||
$thumb_preferred_out_file_dir,
|
$thumb_preferred_out_file_basepath,
|
||||||
$thumb_preferred_out_file_name,
|
|
||||||
$thumb_preferred_out_mime,
|
$thumb_preferred_out_mime,
|
||||||
$thumb_max_width,
|
$thumb_max_width,
|
||||||
$thumb_max_height
|
$thumb_max_height
|
||||||
|
@ -77,8 +74,7 @@ class FallbackMediaHandler implements MediaHandler {
|
||||||
|
|
||||||
public function generateThumb(
|
public function generateThumb(
|
||||||
mixed $handle,
|
mixed $handle,
|
||||||
string $preferred_out_file_dir,
|
string $preferred_out_file_basepath,
|
||||||
string $preferred_out_file_name,
|
|
||||||
string $preferred_out_mime,
|
string $preferred_out_mime,
|
||||||
int $max_width,
|
int $max_width,
|
||||||
int $max_height
|
int $max_height
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue