diff options
| -rwxr-xr-x | edit.php | 5 | ||||
| -rwxr-xr-x | includes/classes/FisheyeImage.php | 11 |
2 files changed, 11 insertions, 5 deletions
@@ -54,10 +54,13 @@ if( !empty( $_REQUEST['savegallery'] ) ) { // set the mappings, or if nothing checked, nuke them all $gContent->addToGalleries( !empty( $_REQUEST['gallery_additions'] ) ? $_REQUEST['gallery_additions'] : null ); + header("location: ".$gContent->getDisplayUrl() ); if( !empty( $_REQUEST['generate_thumbnails'] ) ) { + if( function_exists( 'fastcgi_finish_request' ) ) { + fastcgi_finish_request(); + } $gContent->generateGalleryThumbnails(); } - header("location: ".$gContent->getDisplayUrl() ); die(); } } elseif( !empty( $_REQUEST['delete'] ) ) { diff --git a/includes/classes/FisheyeImage.php b/includes/classes/FisheyeImage.php index c26cedd..76c916b 100755 --- a/includes/classes/FisheyeImage.php +++ b/includes/classes/FisheyeImage.php @@ -520,10 +520,13 @@ class FisheyeImage extends FisheyeBase { $fileHash['dest_branch'] = $this->getStorageBranch( $fileHash ); $fileHash['name'] = $this->getField( 'file_name' ); $fileHash['thumbnail_sizes'] = $pThumbSizes; - // just generate thumbnails - \Bitweaver\Liberty\liberty_generate_thumbnails( $fileHash ); - if( !empty( $fileHash['error'] ) ) { - $this->mErrors['thumbnail'] = $fileHash['error']; + if( substr( $fileHash['type'], 0, 6 ) === 'video/' ) { + \Bitweaver\Liberty\mime_video_create_thumbnail( $fileHash['source_file'] ); + } else { + \Bitweaver\Liberty\liberty_generate_thumbnails( $fileHash ); + if( !empty( $fileHash['error'] ) ) { + $this->mErrors['thumbnail'] = $fileHash['error']; + } } } return count($this->mErrors) == 0; |
