Download the PHP package thepublicgood/laravel-image-renderer without Composer

On this page you can find all versions of the php package thepublicgood/laravel-image-renderer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-image-renderer

This package has been deprecated as I no longer have any use for it and no longer want to maintain it. You can continue to use the package, but I'd recommend looking at the intervention/image package (which this one relies on) as it has URL manipulation built in. There really isn't any need for this package anymore.

Laravel Image Renderer

Build Status

A really simple solution to working with images in Laravel. Especially when using the Artisan storage:link command is not an option.

Installation

Like everything Laravel, the Image Renderer is installed using Composer. From the terminal, in your project root, run:

Once installed, you can publish the config file with:

This will place a renderer.php config file in your project /config directory. Depending on your project, you may want to update some settings in the config file.

Usage

A single route will be registered, the default is to use: /images/{filename} but this can be changed by altering the routes.path key in the config file. You may also wish to alter the storage config options. By default, images are expected to be in /storage/app/images.

Once an image is stored in the correct location, a GET request to http://mysite.test/images/filename.jpg will render the image to the browser. Sub-directories are also supported, so the file /images/gallery/picture.jpg can be rendered by pointing to http://mysite.test/images/gallery/picture.jpg.

Transformers

The Laravel Image Renderer uses the intervention/image page to deal with reading and rendering the image. This means that images can be transformed on the fly. Three transformers are included by default: height, width and square. You can scale an image proportionately by passing the transformer name and value as a URL query:

The intervention/imagecache package is also leveraged to cache the transforms so that they're not rerun on each request. To scale an image by it's height, you can use height=300 or to create a square thumbnail you could use square=400.

Transformers can be combined as well.

Custom Transformers

You can write your own transforms by implementing the TPG\ImageRenderer\Transformers\Contracts\Transformer interface. All transformer classes must implement a handle method which accept two parameters, and be suffixed with Transformer:

The $image is an instance of the Intervention\ImageCache class and the $values array contains any values passed to the query. In the previous example, two values are expected. Remember to return the $image when the transformer is complete.

Once the transformer class is in place, the renderer needs to be told that the transformer is available. This can be done in two ways. You can either call the addTransformer method on the ImageRenderer facade from your AppServiceProvider:

Or you can add it to the transformers config key:

You can now use the transformer from the URL:

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please see [CONTRIBUTING.md]() for mre details.

Please make sure to update tests as appropriate.

License

This package is licensed under the MIT license.


All versions of laravel-image-renderer with dependencies

PHP Build Version
Package Version
Requires php Version >7.3
intervention/image Version ^2.5
intervention/imagecache Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thepublicgood/laravel-image-renderer contains the following files

Loading the files please wait ....