nikashitsa / png-coder
Encodes file to PNG image and decodes from it.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/nikashitsa/png-coder
Requires
- php: >=5.4.0
- ext-gd: *
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2025-10-10 20:12:27 UTC
README
PngCoder is a single PHP class which can encode any file to PNG image and then decode it to original file.
$coder = new PngCoder(); // encode music file to image $coder->encode('./data/music.mp3', './tmp/music.png'); // decode it $coder->decode('./tmp/music.png', './tmp/music.mp3');
Sometimes encoded files looks mysterious, but in common case it's just a noise:
I don't know where this can be used 😟. Feel free to add your suggestions here 😉
Requirements
- PHP 5.4 and later (supports PHP 7)
- php-gd
Installing PngCoder
The recommended way to install PngCoder is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the PngCoder:
composer.phar require nikashitsa/png-coder
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';