ddbase3/tilepack-archive 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ddbase3/tilepack-archive

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ddbase3/tilepack-archive

包简介

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

README 文档

README

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 PHP Version Build Status

🚀 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

Install via Composer:

composer require ddbase3/tilepack-archive

📦 Usage

Create an archive

use TilePack\TilePackWriter;

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

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

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

vendor/bin/phpunit

🤝 License

This project is licensed under the terms of the LGPL.

👤 Author

Daniel Dahme
contourz.de
Photographer and developer with a focus on performance and creative tooling.

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2025-05-05