PHPackages                             ddbase3/tilepack-archive - 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. ddbase3/tilepack-archive

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

ddbase3/tilepack-archive
========================

A fast custom binary archive format with indexed access for tile-based resources

v1.0.1(1y ago)015LGPL-2.1-or-laterPHPPHP &gt;=7.3

Since May 5Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/ddbase3/TilePackArchive)[ Packagist](https://packagist.org/packages/ddbase3/tilepack-archive)[ RSS](/packages/ddbase3-tilepack-archive/feed)WikiDiscussions v1 Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

TilePack Archive
================

[](#tilepack-archive)

**TilePack Archive** is a fast, custom binary archive format with indexed access – designed for tile-based resources such as map tiles, offline assets, or collections of small files.

[![License: LGPL](https://camo.githubusercontent.com/f51424c90e7f500ee9b0a9fe4f64d61933bdd82d2c5a4cd5f2977351d924fcef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4c47504c2d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/32f89e9c9b05b73376fddd286d3925e5b1304395247d716b8a3f74591327f40f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e332d626c75652e737667)](https://www.php.net/)[![Build Status](https://camo.githubusercontent.com/d940ad7f0752e2cbe0d63c50dcebf329078807390051c41fe63258f1b5c4e182/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d627269676874677265656e)](tests/)

---

🚀 Features
----------

[](#-features)

- Compact, binary format with custom header
- Recursively includes all files from a source directory
- Fast indexed access via offset map at the archive’s end
- Ideal for embedded systems, offline distribution, and tiled image rendering
- Supports arbitrary file types (e.g., `.jpg`, `.png`, `.json`, etc.)
- Lightweight – no external decompression tools needed

---

🔧 Installation
--------------

[](#-installation)

Install via [Composer](https://getcomposer.org/):

```
composer require ddbase3/tilepack-archive
```

---

📦 Usage
-------

[](#-usage)

### Create an archive

[](#create-an-archive)

```
use TilePack\TilePackWriter;

$writer = new TilePackWriter();
$writer->createArchive('path/to/tiles/', 'output/archive.tpa');
```

### Read a file from the archive

[](#read-a-file-from-the-archive)

```
use TilePack\TilePackReader;

$reader = new TilePackReader('output/archive.tpa');
$data = $reader->readFile('z/3/x4_y2.jpg');

file_put_contents('copy.jpg', $data);
```

---

📁 Archive Format
----------------

[](#-archive-format)

A TilePack archive consists of:

- A **header** for identification (`TILEPACK`)
- The **tile data**, per file:
    - Path length (uint32)
    - Path (UTF-8)
    - File size (uint32)
    - File content (binary)
- A compact **index** stored at the end:
    - Each entry maps a file path to its byte offset
    - Enables direct seeking with `fseek()` without scanning the archive

---

🧪 Run Tests
-----------

[](#-run-tests)

```
vendor/bin/phpunit
```

---

🤝 License
---------

[](#-license)

This project is licensed under the terms of the [LGPL](LICENSE).

---

👤 Author
--------

[](#-author)

**Daniel Dahme**
[contourz.de](https://contourz.de)
Photographer and developer with a focus on performance and creative tooling.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~79 days

Total

3

Last Release

220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ea7af351924665e6219bf8742d92d892d7d770258a997f1b3862a3b8706f87c?d=identicon)[ddbase3](/maintainers/ddbase3)

---

Top Contributors

[![ddbase3](https://avatars.githubusercontent.com/u/122759330?v=4)](https://github.com/ddbase3 "ddbase3 (3 commits)")

---

Tags

base3-librarybase3-packagistbase3-phpbase3-public

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ddbase3-tilepack-archive/health.svg)

```
[![Health](https://phpackages.com/badges/ddbase3-tilepack-archive/health.svg)](https://phpackages.com/packages/ddbase3-tilepack-archive)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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