Download the PHP package beryllium/rawr without Composer

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

Rawr ===

Rawr is a PHP wrapper for the exiv and exiftool command-line utilities. It enables Preview Extraction, EXIF Data Examination, and EXIF Data Transfer to other image files.

In short: Rawr makes it easier to work with Canon CR2 (RAW) images from within PHP.

Installation Requirements

Running the unit test suite requires both exiv2 and exiftool present in your path. Testing EXIF data transfer requires the php-exif extension; these tests will be skipped if the extension is not found.

Adding Rawr To Your Project

Require Rawr with Composer:

composer require beryllium/rawr

Then, in your code, instantiate Rawr:

$rawr = new Beryllium\Rawr\Rawr('path/to/sandbox', 'path/to/exiv2', 'path/to/exiftool');

(You can leave off the exiftool value if you are not interested in transferring Exif data.)

Why Do I Need Rawr?

Faster Thumbnails for RAW Photos

Generating thumbnails from RAW photos in PHP is very slow. It's also clunky to wire up Imagick to get the proper output.

Each RAW photo actually has one or more built-in JPG previews stored alongside the camera's raw sensor data. Extracting this preview is a handy shortcut for avoiding PHP's slowness. Batch thumbnail operations are much faster with this approach.

Rawr can list previews:

$rawr->listPreviews('path/to/IMAGE.CR2')

The preview list is an array containing information about each preview. Typically, there is a full-size preview in addition to one or more smaller thumbnails.

The example output below demonstrates:

array(
    array(
        'index'  => 1,
        'type'   => 'image/jpeg',
        'height' => 120,
        'width'  => 160,
        'size'   => 14416,
    ),
    array(
        'index'  => 2,
        'type'   => 'image/tiff',
        'height' => 432,
        'width'  => 668,
        'size'   => 1731456,
    ),
    array(
        'index'  => 3,
        'type'   => 'image/jpeg',
        'height' => 3456,
        'width'  => 5184,
        'size'   => 1869241,
    ),
);

Rawr can extract individual previews:

// extracts the specified preview to the sandbox location and returns the resulting temporary filename 
$previewFile = $rawr->extractPreview('path/to/IMAGE.CR2', 3)

You'll want to move the extracted $previewFile out of the sandbox if you want to preserve it. If you're just using it to generate thumbnails, you can leave it in the sandbox and locate the thumbnails elsewhere (and then unlink the $previewFile when you're done).

Don't forget to transfer Exif data to generated thumbnails!

Preserving EXIF Data

Every image taken with your digital camera has special data embedded in the file. This data records the time, camera settings, and even portrait/landscape settings for that image. With some newer cameras, the data can also include GPS coordinates.

Extracting the preview, or even generating a thumbnail from the extracted preview, can result in the loss of this data. Imagick and PHP do not seem to preserve it properly.

Rawr can transfer the EXIF data from the original CR2 file to a JPG:

// to any jpg file
$rawr->transferExifData('path/to/IMAGE.CR2', 'path/to/new_thumbnail.jpg');

// to the preview image you extracted
$rawr->transferExifData('path/to/IMAGE.CR2', $previewFile);

Keep in mind that transferring Exif data can be slow. Expect it to take one or two seconds per call, depending on server CPU/RAM/Disk speed.

Rawr can extract the EXIF data into a consumable format, allowing you to make decisions based on the data:

// translated format
$translatedData = $rawr->listExifData('path/to/IMAGE.CR2', Rawr::EXIF_TRANSLATED);

// raw format
$data = $rawr->listExifData('path/to/IMAGE.CR2');

The Past and Future of Rawr

I built Rawr as part of a home photography project. I needed to quickly generate thumbnails for 22,000 CR2 files. Doing it by rendering the RAW out to a JPG using ImageMagick could've taken years.

If the project helps you out, great! If you find issues with it, please contribute by either logging an issue or a PR on the project.

In the future, I would like to support a wider variety of RAW formats.


All versions of rawr with dependencies

PHP Build Version
Package Version
No informations.
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 beryllium/rawr contains the following files

Loading the files please wait ....