function photo_getEmbedThumbnail($sUserId, $sImageUrl) { global $sFilesPath; global $sFilesUrl; global $sFfmpegPath; $sFilePath = $sFilesPath . $sUserId . IMAGE_EXTENSION; $sCommand = $sFfmpegPath . " -y -i " . $sImageUrl . " -ss 0 -vframes 1 -an -f image2 " . $sFilePath; @popen($sCommand, "r"); if (file_exists($sFilePath) && filesize($sFilePath) > 0) { return photo_getRecordThumbnail($sUserId); } else { return false; } }
function _recordPhoto() { $sAuthorCheck = $this->checkAuthorBeforeAdd(); if (empty($sAuthorCheck)) { global $sFilesPath; $sRecordThumbUrl = photo_getRecordThumbnail($this->_getAuthorId()); if ($sRecordThumbUrl) { $aDefault = array('image' => $sRecordThumbUrl, 'type' => "record"); return $this->GenSendFileInfoForm(1, $aDefault); } else { return $this->getFileAddError(); } } else { return $sAuthorCheck; } }