streams/library/php-id3
2020-06-15 18:01:20 -07:00
..
PhpId3 move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
Tests move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
.gitignore move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
composer.json move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
LICENSE move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
phpunit.xml.dist move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00
README.md move php-id3 and text_languagedetect from composer (/vendor) back to /library because their autoloaders are no longer supported in composer and no longer work in some distros. The packages themselves are unmaintained and it is unlikely they will be fixed upstream. This leaves HTMLPurifier to be fixed - which is in progress and should happen in the next several days. 2020-06-15 18:01:20 -07:00

#PHP-ID3

PHP-ID3 makes use of native PHP to read ID3 Tags and thumbnail from a MP3 file. There have been many revisions to ID3 Tags specification; this program makes use of v3.2 of the spec.

To read binary data more effectively, I have created a sclass, BinaryFileReader, which reads data in named chunks.

##How to Install

Into your composer.json

{
    "require" : {
        "shubhamjain/php-id3": "dev-master"
    }
}

##How to Use

You will first need to include the autoload.php generated by composer and then you can use the classes in PhpId3 namespace.

<?php

require 'vendor/autoload.php';

//...
use PhpId3\Id3TagsReader;

//...
$id3 = new Id3TagsReader(fopen("Exodus - 06 - Piranha.mp3", "rb"));

$id3->readAllTags(); //Calling this is necesarry before others

foreach($id3->getId3Array() as $key => $value) {
	if( $key !== "APIC" ) { //Skip Image data
		echo $value["FullTagName"] . ": " . $value["Body"] . "<br />"; 
    }
}

list($mimeType, $image) = $id3->getImage();

file_put_contents("thumb.jpeg", $image ); //Note the image type depends upon MimeType

//...

##LICENSE

See LICENSE for more informations

##Feedback

If you used this project or liked it or have any doubt about the source, send your valuable thoughts at shubham.jain.1@gmail.com.