Download the PHP package biggleszx/craft-picture without Composer

On this page you can find all versions of the php package biggleszx/craft-picture. 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 craft-picture

Craft Picture (a Twig Bundle)

This is a Twig Bundle intended to be used via nystudio107's Bundle Installer. It provides a Picture template which is designed to make it easier to generate <picture> elements for responsive imagery using Craft CMS's image asset helpers. Pass in an image and some basic settings and a <picture> element will be rendered including a range of srcset candidates and alternative sources for the WebP format.

Installation

Follow the installation instructions for Bundle Installer, which essentially boil down to:

You should be prompted to give allow-plugins permission for that package.

Add this package:

Install:

Add /templates/vendor to your root .gitignore file to avoid committing installed bundles to Git.

Configuration

The Picture component needs to know which widths to use when transforming your images to generate srcset candidates. The default widths are:

...however you can override this on a per-usage basis (see below), or set a project-wide default by adding a craftPictureSourceWidths key to your custom settings file:

You will also need to have set up at least one named image transform so that the component knows how to transform your images.

Usage

In the kitchen-sink example below:

When using the media parameter, order matters the same way it does when writing plain HTML. The browser will use the first matching media configuration it encounters. Inside media, sourceWidths is optional and defaults to the root sourceWidths if omitted. Order doesn't matter in this parameter.

When processing sourceWidths or media.sourceWidths, we filter out any sizes that are larger than the width of the original image. If this results in an empty array, we add back the original intrinsic image width as the sole value.

Contributing

This package is mostly for my benefit in cutting down duplicated code between projects, however I hope it has broader usefulness. If you have any issues using the bundle, please feel free to open an issue on GitHub, and I'll take a look when I can.

TODO


All versions of craft-picture with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version >=5.0
twig/twig Version >=3
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 biggleszx/craft-picture contains the following files

Loading the files please wait ....