PHPackages                             buonzz/scalp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. buonzz/scalp

ActiveLibrary[File &amp; Storage](/categories/file-storage)

buonzz/scalp
============

Command line tool to Analyze and store your Media file's metadata

v2.1.2(8y ago)033[16 issues](https://github.com/buonzz-systems/scalp/issues)MITPHPPHP &gt;=5.4

Since Oct 11Pushed 7y agoCompare

[ Source](https://github.com/buonzz-systems/scalp)[ Packagist](https://packagist.org/packages/buonzz/scalp)[ RSS](/packages/buonzz-scalp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (0)

Scalp
=====

[](#scalp)

Command line tool to Analyze and store your Media file's metadata.

Do you or your organization have a bunch of images/videos lumped into some hard drive? If those are stored in a non-structured way, like there is no real scheme on how it is organized (by date, by album etc). Performing analysis and retrieving a certain set of files will be really tough to do.

Scalp allows you analyze and extract a lot of information from those bunch of media files and build "something" out of that data. It is purely a backend tool that is designed to support any kind of application you might be developing on that top of the extracted info.

Few situations it could be useful:

- Build a private Search engine, that allows user to input certain keywords and return a list of files matching that keyword
- Use as a backend store for your CMS
- Generate thumbnails (small/medium/large) and host the processed files to CDN

Below is the overview of how Scalp works

[![scalp architecture diagram](https://camo.githubusercontent.com/e04cc36e54f9a3e5a81e4407e1fe1139099baa4d5939769b8dd10fd728140611/68747470733a2f2f6173736574732e62756f6e7a7a2e636f6d2f7363616c702d6172636869746563747572652e706e67)](https://camo.githubusercontent.com/e04cc36e54f9a3e5a81e4407e1fe1139099baa4d5939769b8dd10fd728140611/68747470733a2f2f6173736574732e62756f6e7a7a2e636f6d2f7363616c702d6172636869746563747572652e706e67)

- Your media files can be stored in the same server or a dedicated NAS server (needs to be mounted to a location where scalp can access it )
- Scalp reads the files and extract Metadata from it (represented as JSON object)
- Scalp generates thumbnails (small/medium/large)
- The data processed can then be forwarded to any of the supported backend storage (File, ElasticSearch, S3, BackBlaze etc)
- Your application accesses the processed data via those backend storage

### Advantages

[](#advantages)

- You can continously re-organize how the files is presented to your users without having to physically move around the actual files. Since the representation can be abstracted by the Application itself
- Your raw images/videos is left untouched (Scalp never move, resize or modify its properties)
- Saves a lot of bandwidth, since instead of serving the raw images while browsing items. You can just use the thumbnails created by Scalp. and only access the raw (usually big file) image when user requested.

Requirements
------------

[](#requirements)

- Linux-based Server (Debian/RHEL etc)
- PHP 5.4 or greater

Install
=======

[](#install)

It is very easy to install Scalp as a CLI utility:
via wget

```
wget https://downloads.buonzz.com/scalp.phar
sudo mv scalp.phar  /usr/local/bin/scalp
chmod +x /usr/local/bin/scalp

```

via curl

```
curl -o scalp.phar 'https://downloads.buonzz.com/scalp.phar'
sudo mv scalp.phar  /usr/local/bin/scalp
chmod +x /usr/local/bin/scalp

```

After this, scalp command is available anywhere in your computer. To check if the scalp is installed properly, just execute

```
scalp -V

```

This should output

```
Scalp Metadata Extraction Tool by Darwin Biler version v2

```

#### via Composer - Globally

[](#via-composer---globally)

You can install scalp globally in your machine:

```
composer global require 'buonzz/scalp=dev-master'

```

Simply add this directory to your PATH in your ~/.bash\_profile (or ~/.bashrc) like this:

```
export PATH=~/.composer/vendor/bin:$PATH

```

#### via Composer - per-project

[](#via-composer---per-project)

just require the buonzz/scalp in your composer project

```
{
"require":{
    "buonzz/scalp": "1.*"
  }
}

```

Usage
=====

[](#usage)

Scalp can extract the metadata information from your media files and export it to following:

- Static JSON files
- Thumbnails

First, you need to create a configuration file called .env This will be used by scalp to retrieve certain information:

SettingDescriptionDefaultINPUT\_FOLDERthe folder on which to read the files to analyzecurrent folderOUTPUT\_FOLDERwhere to dump the JSON files / thumbnailsdistTHUMB\_PERCENT\_RESIZEUsed when creating thumbnails, this should be between 10-100, the images will be resized with this percent value10#### Metadata Extraction

[](#metadata-extraction)

To generate static JSON files

```
scalp metadata:extract

```

Sample extracted metadata

```
{
   "last_modified":"2017-03-25T12:10:39+00:00",
   "last_accessed":"2017-04-09T12:07:11+00:00",
   "file_permissions":"0644",
   "date_indexed":"2017-04-10T03:04:23+00:00",
   "human_filesize":"974.83 kB",
   "filepath":"IMG_1123.JPG",
   "path_tags":[

   ],
   "filesize":"998225",
   "fileformat":"jpg",
   "filename":"IMG_1123.JPG",
   "mime_type":"image\/jpeg",
   "exif":{
      "DateTimeDigitized":"2016-05-17T16:19:26+00:00",
      "ExposureTime":0.016666666666667,
      "FNumber":4,
      "ISOSpeedRatings":200,
      "ShutterSpeedValue":6,
      "ApertureValue":4,
      "FocalLength":20
   },
   "date_tags":[
      "Tue",
      "17th",
      "Tuesday",
      "May",
      "May",
      "2016",
      "4pm",
      "UTC",
      "17"
   ],
   "file_contents_hash":"4c7e796bc250b14fe7964694c4db5852eca34ddee24991371f848c3e8097436d",
   "width":"1920",
   "height":"1280"
}

```

#### Thumbnail Creation

[](#thumbnail-creation)

```
scalp thumbnail:create

```

### Running in the background

[](#running-in-the-background)

If you got a relatively large collection of media files. It might take hours for the process to complete. You can place the process in the background, so that it will continue to execute even after you had logged out in the terminal.

```
nohup scalp metadata:extract > scalp.log &
nohup scalp thumbnail:create > scalp.log &

```

Backend Storage
---------------

[](#backend-storage)

The processed data can be stored in multitude of ways. Allowing you to freely use its data in whatever purpose it may serve for your use-case.

### File

[](#file)

The simpliest backend is the file storage. It simply dumps everything to whatever you had defined in the *OUTPUT\_FOLDER* configuration in your .env file. You can either use the generated files and host it to your web server/CDN or pass it to your application for further processing.

### ElasticSearch

[](#elasticsearch)

When using ElasticSearch as a backend. Make sure to provide the following entries in your .env file

SettingDescriptionDefaultDB\_HOSTNAMEdatabase hostname for the ElasticSearch ServerlocalhostDB\_NAMEindex name of the documents in ElasticSearchmetadataDOC\_TYPEthe document type in ES (table name for RDBMS)filesDB\_PORTport number for ES9200DB\_USERusername for the databasenullDB\_PASSWORDdatabase passwordnullLOG\_FOLDERwhere to write the log file, this is the log file generated by ElasticSearch client. Useful in debugginglogsLoad it to ElasticSearch

```
scalp es:index

```

Save thumbnails to ElasticSearch

```
scalp thumb:save

```

##### Viewing the thumbnails

[](#viewing-the-thumbnails)

You can get a preview of those thumbnails by using the PHP's built in web server

```
php -S localhost:8080 /usr/local/bin/scalp

```

then in your localhost, just append the url given by search command.

### BackBlaze's B2 Cloud Storage

[](#backblazes-b2-cloud-storage)

B2 is a great way to store both your metadata and thumbnails if you plan to serve those data in a web site with high traffic. It is way cheaper than the other alternative, plus it offers you a free 10GB initial storage so you don't really need to pay anything unless you decide to upload more contents.

Provide the following entries in your *.env* file prior to using the BackBlaze

SettingValueB2\_ACCOUNT\_IDyour BackBlaze account IDB2\_APPLICATION\_KEYApplication key for your accountThen execute the following to extract, create thumbnail and upload the data to B2:

```
scalp b2:upload scalp-test dist

```

the first parameter (scalp-test) is the bucket name you created in your backblaze account, and the second parameter is the folder where the files to be uploaded is located.

### AWS S3

[](#aws-s3)

TODO

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~118 days

Recently: every ~151 days

Total

11

Last Release

3043d ago

Major Versions

1.0.4 → v2.0.02016-03-01

PHP version history (2 changes)1.0.1PHP &gt;=5.3.28

v2.0.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ace28ed0f8f9067b0083c1cdce556c1b183d91d8cf2ef65a01736fe1c1464782?d=identicon)[buonzz](/maintainers/buonzz)

---

Top Contributors

[![buonzz](https://avatars.githubusercontent.com/u/946233?v=4)](https://github.com/buonzz "buonzz (213 commits)")

---

Tags

backblazebucketgeneratorobjects3storagethumbnailimageelasticsearchvideogetid3content managementmedia files

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/buonzz-scalp/health.svg)

```
[![Health](https://phpackages.com/badges/buonzz-scalp/health.svg)](https://phpackages.com/packages/buonzz-scalp)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M16.9k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[fof/upload

The file upload extension for the Flarum forum with insane intelligence.

188171.7k15](/packages/fof-upload)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M385](/packages/shopware-core)[transloadit/php-sdk

Transloadit SDK

63393.6k2](/packages/transloadit-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
