Download the PHP package ikechukwuokalia/php-ico without Composer

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

PHP ICO - The PHP ICO Generator

PHP ICO provides an easy-to-use PHP class that generates valid ICO files. Note that these are not simply BMP, GIF, or PNG formatted images with an extension of ico, the images generated by this class are fully valid ICO-formatted image files.

The class uses the GD library for reading an image from the source file and uses pure PHP for generating the ICO file format. In theory, any image format that GD can read can be used as a source image to generate the ICO file. I tested this library with JPEG, GIF, and PNG images with great results. If an animated GIF is supplied, the first frame will be used to generate the ICO image.

The PHP ICO library is available on Composer via Packagist at chrisjean/php-ico.

ICO Format Details

The primary goal of creating this class was to have a simple-to-use and reliable method of generating ICO files for use as favicons in websites. This goal drove much of the development and is the reason for some of the limitations in the resulting functionality.

ICO files support two different ways of encoding the actual image data: the Windows BMP format and the PNG format. Since support for the PNG format was introduced in Windows Vista and both older and newer versions of Windows support the BMP enocoding, the BMP encoding method was used.

Images are encoded using 32 bits per pixel. This allows for alpha channel information in the resulting images. Support for 32 bit images was added in Windows XP. This means that older versions of Windows are not likely to display the ICO images properly, if at all. The generated images have not been tested on versions of Windows predating XP.

Usage

The following is a very basic example of using the PHP ICO library:

`

It takes a source file named example.gif and produce an output ICO file named example.ico. example.ico will contain a single image that is the same size as the source image.

The ICO file format is capable of holding multiple images, each of a different size. The PHP ICO library opens up this feature of the ICO format as shown in the following example:

As with the previous example, this example produces example.ico from the example.gif source file. In this example, sizes were passed to the constructor that result in the example.ico file containing two images: one that is 32x32 and one that is 64x64. Since the same source image is used for each of the contained images, each contained image is simply the source image scaled to the new dimensions.

Using different source images for the different sizes contained inside an ICO file can create much better results. For instance, you can use a high-quality image for higher-resolution images and use smaller images that are tailored for their specific dimensions for the smaller sizes. The following example shows how the PHP ICO library can be used to create such ICO files:

This example creates a single ICO file named example.ico just as the previous examples. The difference is that this example used multiple source images to generate the final ICO images. The final ICO image contains a total of six images: 16x16, 24x24, and 32x32 images from example-small.gif; 48x48 and 96x96 images from example-medium.gif; and a 128x128 image from example-large.gif.

By using this feature of supplying multiple source images with specific sizes for each, you can generate ICO files that have very high-quality images at each supplied resolution.

Since the PHP ICO library was created to generate favicon files, the following example shows how to generate a favicon ICO file with all the needed dimensions from a single source image:

I've found that the 16x16, 24x24, 32x32, and 48x48 image sizes cover all the sizes that browsers and Windows will try to use a favicon image for. The different sizes come from using the favicon for various browser icons, bookmarks, and various other places.

Thanks

I'd like to thank iThemes for making this project possible. This code was originally developed to add easy-to-use favicon support to the Builder theme. I asked Cory, owner of iThemes and my boss, if I could share the final code. He gave me the green light. Win for everyone. :)

Thanks iThemes. Thanks Cory.


All versions of php-ico with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.4
ext-gd Version *
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 ikechukwuokalia/php-ico contains the following files

Loading the files please wait ....