Better event name (creating thumbnail _source_)
This commit is contained in:
parent
b3bf036975
commit
86ddf120d7
@ -1441,7 +1441,7 @@ OtherAccountProfiles: Hook to add account profiles to a user account profile blo
|
|||||||
text: text for the profile
|
text: text for the profile
|
||||||
image: mini image for the profile
|
image: mini image for the profile
|
||||||
|
|
||||||
CreateFileImageThumbnail: Hook to create image thumbnail source from a File
|
CreateFileImageThumbnailSource: Hook to create image thumbnail source from a File
|
||||||
- $file: MediaFile object with related metadata
|
- $file: MediaFile object with related metadata
|
||||||
- &$imgPath: Path to image file which can be used as source for our thumbnail algorithm.
|
- &$imgPath: Path to image file which can be used as source for our thumbnail algorithm.
|
||||||
- $media: MIME media type ('image', 'video', 'audio' etc.)
|
- $media: MIME media type ('image', 'video', 'audio' etc.)
|
||||||
|
@ -120,7 +120,7 @@ class MediaFile
|
|||||||
$imgPath = null;
|
$imgPath = null;
|
||||||
$media = common_get_mime_media($this->mimetype);
|
$media = common_get_mime_media($this->mimetype);
|
||||||
|
|
||||||
if (Event::handle('CreateFileImageThumbnail', array($this, &$imgPath, $media))) {
|
if (Event::handle('CreateFileImageThumbnailSource', array($this, &$imgPath, $media))) {
|
||||||
switch ($media) {
|
switch ($media) {
|
||||||
case 'image':
|
case 'image':
|
||||||
$imgPath = $this->getPath();
|
$imgPath = $this->getPath();
|
||||||
|
@ -41,12 +41,12 @@ class VideoThumbnailsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This function should only extract an image from the video stream
|
* This function should only extract an image from the video stream
|
||||||
* and disregard any scaling aspects in the resulting file, since
|
* and disregard any cropping or scaling in the resulting file, as
|
||||||
* this will be handled in the core thumbnail algorithm.
|
* that will be handled in the core thumbnail algorithm.
|
||||||
*/
|
*/
|
||||||
public function onCreateFileImageThumbnail(MediaFile $file, &$imgPath, $media=null)
|
public function onCreateFileImageThumbnailSource(MediaFile $file, &$imgPath, $media=null)
|
||||||
{
|
{
|
||||||
// This might accidentally pass application/ogg videos.
|
// The calling function might accidentally pass application/ogg videos.
|
||||||
// If that's a problem, let's fix it in the calling function.
|
// If that's a problem, let's fix it in the calling function.
|
||||||
if ($media !== 'video') {
|
if ($media !== 'video') {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user