Browse Source

add webp image type support

master
filesite 2 years ago
parent
commit
f8fc6601ba
  1. 5
      conf/app.php
  2. 5
      lib/DirScanner.php
  3. 2
      themes/googleimage/views/site/index.php

5
conf/app.php

@ -30,19 +30,20 @@ $configs = array(
'debug' => true, 'debug' => true,
//for themes //for themes
/*
//图片皮肤配置 //图片皮肤配置
'googleimage' => array( 'googleimage' => array(
'imageHeight' => 350, //图片高度,单位:px 'imageHeight' => 350, //图片高度,单位:px
'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
'supportedImageExts' => array('jpg', 'jpeg', 'png', 'webp', 'gif'),
), ),
*/
/*
//视频皮肤配置 //视频皮肤配置
'videoblog' => array( 'videoblog' => array(
'imageHeight' => 180, //图片高度,单位:px 'imageHeight' => 180, //图片高度,单位:px
'contact' => 'FileSite视频网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', 'contact' => 'FileSite视频网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
), ),
*/
//目前支持的皮肤 //目前支持的皮肤
'allowedThemes' => array( 'allowedThemes' => array(

5
lib/DirScanner.php

@ -1,7 +1,6 @@
<?php <?php
/** /**
* Class DirScanner * Class DirScanner
* TODO: 兼容windows系统目录结构
*/ */
Class DirScanner { Class DirScanner {
@ -44,6 +43,7 @@ Class DirScanner {
'jpg', //图片 'jpg', //图片
'jpeg', //图片 'jpeg', //图片
'png', //图片 'png', //图片
'webp', //图片
'gif', //图片 'gif', //图片
'ico', //图标 'ico', //图标
'mp4', //视频 'mp4', //视频
@ -57,6 +57,7 @@ Class DirScanner {
'jpg' => 512000, //图片 'jpg' => 512000, //图片
'jpeg' => 512000, //图片 'jpeg' => 512000, //图片
'png' => 512000, //图片 'png' => 512000, //图片
'webp' => 512000, //图片
'gif' => 512000, //图片 'gif' => 512000, //图片
'ico' => 51200, //图标 'ico' => 51200, //图标
'mp4' => 104857600, //视频 'mp4' => 104857600, //视频
@ -67,6 +68,7 @@ Class DirScanner {
'jpg', //图片 'jpg', //图片
'jpeg', //图片 'jpeg', //图片
'png', //图片 'png', //图片
'webp', //图片
'gif', //图片 'gif', //图片
'ico', //图标 'ico', //图标
'mp4', //视频 'mp4', //视频
@ -363,6 +365,7 @@ Class DirScanner {
'jpg' => "{$webRoot}{$directory}{$filename}.{$extension}", 'jpg' => "{$webRoot}{$directory}{$filename}.{$extension}",
'jpeg' => "{$webRoot}{$directory}{$filename}.{$extension}", 'jpeg' => "{$webRoot}{$directory}{$filename}.{$extension}",
'png' => "{$webRoot}{$directory}{$filename}.{$extension}", 'png' => "{$webRoot}{$directory}{$filename}.{$extension}",
'webp' => "{$webRoot}{$directory}{$filename}.{$extension}",
'gif' => "{$webRoot}{$directory}{$filename}.{$extension}", 'gif' => "{$webRoot}{$directory}{$filename}.{$extension}",
'ico' => "{$webRoot}{$directory}{$filename}.{$extension}", 'ico' => "{$webRoot}{$directory}{$filename}.{$extension}",
'mp4' => "{$webRoot}{$directory}{$filename}.{$extension}", 'mp4' => "{$webRoot}{$directory}{$filename}.{$extension}",

2
themes/googleimage/views/site/index.php

@ -42,7 +42,7 @@ eof;
<div class="content"> <div class="content">
<?php <?php
$imgExts = array('jpg', 'jpeg', 'png', 'gif'); $imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif');
$category = !empty($viewData['scanResults'][$selectedId]) ? $viewData['scanResults'][$selectedId] : []; $category = !empty($viewData['scanResults'][$selectedId]) ? $viewData['scanResults'][$selectedId] : [];
//当前目录的描述介绍 //当前目录的描述介绍

Loading…
Cancel
Save