-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e92730
commit d49d210
Showing
5 changed files
with
365 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
use App\Http\Requests; | ||
|
||
/* | ||
* | ||
* Parameter Mearning Example | ||
w Maximum width /slir/w100/path/to/image.jpg | ||
h Maximum height /slir/h100/path/to/image.jpg | ||
c Crop ratio /slir/c1x1/path/to/image.jpg | ||
q Quality /slir/q60/path/to/image.jpg | ||
b Background fill color /slir/bf00/path/to/image.png | ||
p Progressive /slir/p1/path/to/image.jpg | ||
g Grayscale /slir/g1/path/to/image.jpg | ||
*/ | ||
|
||
class SlirController extends Controller | ||
{ | ||
// | ||
public function slirAction($size, $user_id, $album_id, $file_path) | ||
{ | ||
define('SLIR_CONFIG_CLASSNAME', \App\SLIR\SLIRConfig::class); | ||
|
||
$slir = new \SLIR\SLIR(); | ||
$slir->processRequestFromURL(); | ||
|
||
// SLIR handle response by itself | ||
// Do not return anything | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* User: ZE | ||
* Date: 2016/12/01 | ||
* Time: 1:23 | ||
*/ | ||
|
||
namespace App\SLIR; | ||
|
||
|
||
class SLIRConfig extends \SLIR\SLIRConfigDefaults | ||
{ | ||
public static function init() | ||
{ | ||
static::$garbageCollectDivisor = 400; | ||
static::$garbageCollectFileCacheMaxLifetime = 345600; | ||
static::$browserCacheTTL = 604800; // 7*24*60*60 | ||
static::$pathToCacheDir = storage_path('SLIR/cache'); | ||
static::$pathToErrorLog = storage_path('SLIR/files/slir-error-log'); | ||
static::$documentRoot = storage_path('app/photos'); | ||
static::$urlToSLIR = '/slir'; // Tell SLIR to listen after "/assets" route | ||
static::$maxMemoryToAllocate = 64; | ||
// This must be the last line of this function | ||
parent::init(); | ||
} | ||
} | ||
|
||
SLIRConfig::init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.