$new_height = round($height * (1 / $yscale)); } else { $new_width = round($width * (1 / $xscale)); $new_height = round($height * (1 / $xscale)); } //Resizetheoriginalimage $imageResized = imagecreatetruecolor($new_width, $new_height); $imageTmp = imagecreatefromjpeg($originalImage); imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height); return imagejpeg($imageResized); } header("Content-Type: image/jpeg"); ini_set("display_errors", "off"); switch ($_GET['ac']) { case 'et': $EpisodeInfo = $XBMC->GetEpisodeInformation($_GET['id']); $path = $EpisodeInfo['filePath']; $searchpath = $XBMC->XBMCUserDataPath . "Thumbnails/"; break; case 'sb': $ShowInfo = $XBMC->RetrieveShowInfo($_GET['id']); $path = $ShowInfo['folder']; $searchpath = $XBMC->XBMCUserDataPath . "Thumbnails/"; break; case 'sf': $ShowInfo = $XBMC->RetrieveShowInfo($_GET['id']); $path = $ShowInfo['folder']; $searchpath = $XBMC->XBMCUserDataPath . "Thumbnails/Video/Fanart/"; } $filename = _get_hash($path) . ".tbn"; $filename2 = _get_hash($path) . ".jpg";
* the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* TODO: Filename support and path substitution on Samba Shares */ /* PROPOSED: merge to stream.php */ require 'libs/XBMCHelper.class.php'; $XBMC = new XBMCHelper(); $videoInformation = $XBMC->GetEpisodeInformation($_GET['e']); ini_set("max_execution_time", "0"); $file = $videoInformation['filePath']; $streampath = parse_url($file); if (isset($streampath['scheme']) && $streampath['scheme'] == "smb://") { // We found that the filepath includes smb://, by this we have determined a // Synchronized XBMC installation and substitute direct paths for searching for the file // In the library. $di = new RecursiveDirectoryIterator($XBMC->XBMCTVLibraryPath); foreach (new RecursiveIteratorIterator($di) as $filename => $cur) { if ($cur->getFilename() == $videoInformation['filename']) { $file = $filename; break; } } }