Download the PHP package aneeskhan47/php-cloudflare-image-resizing without Composer

On this page you can find all versions of the php package aneeskhan47/php-cloudflare-image-resizing. 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 php-cloudflare-image-resizing

PHP Cloudflare Image

GitHub Workflow Status (master) Total Downloads Latest Version License


A PHP package to generate Cloudflare Image Resizing URLs. based on Cloudflare Image Resizing.

โšก๏ธ Installation

Requires PHP 8.2+


โ“ How it works

Cloudflare Image Resizing is a feature that allows you to resize, crop, and convert images by simply changing the URL of the image. This is done by adding a set of image transformation parameters to the URL of the image, which Cloudflare will then use to generate a new image on the fly.

So just by adding /cdn-cgi/image/ to the beginning of the URL, you can utilize Cloudflare's image resizing feature.

You can convert and resize images by requesting them via a specially-formatted URL. This way you do not need to write any code, only change HTML markup of your website to use the new URLs.

For more information, please see the Cloudflare Image Resizing documentation.

This package provides a fluent API to generate Cloudflare Image Resizing URLs.


๐Ÿš€ Usage

Generating a URL without any transformations

Generating a URL with transformations

Available transformations

Transformation Description Cloudflare Docs
anim(bool) Whether to animate the image Docs
background(string) Background color in CSS format (hex, rgb, rgba, hsl, hsla) Docs
blur(int) Blur radius between 1 (slight blur) and 250 (maximum) Docs
brightness(string) Value of 1.0 equals no change, 0.5 equals half brightness, 2.0 equals twice as bright Docs
compression(string) Compression value Docs
contrast(float) Value of 1.0 equals no change, 0.5 equals low contrast, 2.0 equals high contrast Docs
dpr(int) Device pixel ratio multiplier for width/height Docs
fit(string) Fit mode (scale-down, contain, cover, crop, pad) Docs
format(string) Output format (avif, webp, jpeg, baseline-jpeg, json) Docs
avif() Set the format to avif. alias for format('avif'). Docs
webp() Set the format to webp. alias for format('webp'). Docs
jpeg() Set the format to jpeg. alias for format('jpeg'). Docs
baselineJpeg() Set the format to baseline-jpeg. alias for format('baseline-jpeg'). Docs
json() Set the format to json. alias for format('json'). Docs
gamma(float) Value of 1.0 equals no change, 0.5 darkens, 2.0 lightens Docs
gravity(string) Cropping gravity (auto, left, right, top, bottom) Docs
height(int) Height in pixels Docs
metadata(string) Metadata preservation mode (keep, copyright, none) Docs
onerror(string) Error handling mode (redirect, none) Docs
quality(int) Quality between 1 (lowest) and 100 (highest) Docs
rotate(int) Rotation degrees (90, 180, or 270) Docs
saturation(float) Value of 1.0 equals no change, 0.5 equals half saturation, 2.0 equals twice as saturated Docs
sharpen(float) Sharpening strength between 0 (none) and 10 (maximum) Docs
trim(string) Trim values in format "top;right;bottom;left" Docs
width(int) Width in pixels Docs

๐Ÿงช Testing

๐Ÿงน Keep a modern codebase with Pint:

โœ… Run refactors using Rector

โš—๏ธ Run static analysis using PHPStan:

โœ… Run unit tests using PEST

๐Ÿš€ Run the entire test suite:


๐Ÿ“ Changelog

Please see CHANGELOG for more information on what has changed recently.


๐Ÿค Contributing

Please see CONTRIBUTING for details.


๐Ÿ”’ Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.


๐Ÿ™Œ Credits


๐Ÿ“œ License

The MIT License (MIT). Please see License File for more information.


๐Ÿ”ง Skeleton PHP Boilerplate

This package was generated using the Skeleton PHP by Nuno Maduro.


All versions of php-cloudflare-image-resizing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
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 aneeskhan47/php-cloudflare-image-resizing contains the following files

Loading the files please wait ....