Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/megaads-vn/timthumb
https://github.com/megaads-vn/timthumb
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/megaads-vn/timthumb
- Owner: megaads-vn
- Created: 2020-08-11T09:49:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-22T03:17:07.000Z (over 4 years ago)
- Last Synced: 2024-12-10T14:42:55.058Z (29 days ago)
- Language: PHP
- Size: 39.1 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This project is not under development anymore. Check spescina/imgproxy instead
I think that this feature has to be left outside the framework. I don't like that Laravel has to be booted upon each image request.# Timthumb
An image proxy for Laravel## Installation
To install __Timthumb__ as a Composer package to be used with Laravel 4, simply add this to your `composer.json`:
```javascript
"spescina/timthumb": "1.0.*"
```
and run composer update.Once it's installed, you have to register the service provider. In `app/config/app.php` add the following line of code to the `providers` array:
```php
'Spescina\Timthumb\TimthumbServiceProvider'
```
If you want in `app/config/app.php` add the following line of code to the `alias` array
```php
'Timthumb' => 'Spescina\Timthumb\Facades\Timthumb'
```
Then, publish the config files with `php artisan config:publish spescina/timthumb`.Then, publish the asset files with `php artisan asset:publish spescina/timthumb`.
## Usage
Generate the image link with the following line of code
```php
$url = Timthumb::link('path/to/image.jpg',width,height)
```
Set 0 width or 0 height to let Timthumb mantain the original image ratio