Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
71ddc92
Fix a free format mp3 files
StudioMaX Dec 22, 2021
73e16a9
Merge pull request #358 from StudioMaX/mp3-freeformat
JamesHeinrich Dec 22, 2021
8ca97be
Work around divide by zero bug in MPEG-2 aspect ratio
bvibber Dec 22, 2021
d8b8c77
Merge pull request #359 from brion/mpeg2-edge-case
JamesHeinrich Dec 23, 2021
c7543f8
GH Actions: version update for `ramsey/composer-install`
jrfnl Dec 25, 2021
341d335
Merge pull request #362 from jrfnl/feature/ghactions-update-composer-…
JamesHeinrich Dec 25, 2021
6009a59
Fix typos in some Header Extension Object headers
StudioMaX Dec 28, 2021
06382ae
Add support for some new GUIDs inside Header Extension Object
StudioMaX Dec 28, 2021
a461450
Merge pull request #363 from StudioMaX/asf-guids
JamesHeinrich Dec 28, 2021
15784c4
PHP 8.1: Deprecated: str_replace(): Passing null to parameter #2 ($re…
StudioMaX Dec 28, 2021
58ce18e
PHP 8.1: Deprecated: substr(): Passing null to parameter #1 ($string)…
StudioMaX Dec 28, 2021
6f0cf60
Add support for ANIMEXTS1.0 Application Extension in gif files
StudioMaX Dec 28, 2021
73a25a8
Merge pull request #364 from StudioMaX/php8.1-warnings
JamesHeinrich Dec 28, 2021
e1e92b1
#365 Trying to access array offset on value of type int
JamesHeinrich Jan 3, 2022
46346ff
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Jan 3, 2022
2279f7c
change @error-suppress to isset (quicktime)
JamesHeinrich Feb 3, 2022
fd5edb5
Typo fixed in getid3/getid3.php
rafiahmedd Feb 17, 2022
81cf18e
Merge pull request #368 from rafiahmedd/typo
JamesHeinrich Feb 17, 2022
57a2a83
#369 fix remote urls pattern
JamesHeinrich Feb 22, 2022
bcbba5a
Quicktime parse ID32 frames
JamesHeinrich Apr 1, 2022
c561bfd
fragmented MP4 unsupported warning
JamesHeinrich Apr 1, 2022
1051a47
Add Installation docs
Apr 13, 2022
56002d3
Merge pull request #373 from dmitryuk/readme
JamesHeinrich Apr 13, 2022
079c4d7
MOD improved SoundTracker support
JamesHeinrich Apr 14, 2022
4582f7c
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Apr 14, 2022
9a76510
Define options to suppress warnings generated by invalid iXML content…
ben-xo Apr 17, 2022
00bd8bf
Merge pull request #376 from ben-xo/bugfix/ignore-xml-entity-warnings
JamesHeinrich Apr 17, 2022
630b7a7
The type has been identified. ($BitrateCache[$FrameLength]])
aliyilmaz Apr 18, 2022
04cf0d9
Merge pull request #378 from aliyilmaz/master
JamesHeinrich Apr 19, 2022
aaa7817
MOD song_length
JamesHeinrich May 1, 2022
f8740d2
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich May 1, 2022
28c9444
GH Actions: run lint against PHP 8.2
jrfnl Jun 19, 2022
b5ec6d3
Merge pull request #385 from jrfnl/feature/ghactions-lint-against-php…
JamesHeinrich Jun 19, 2022
8fb5161
Quicktime extended atom size
JamesHeinrich Jun 21, 2022
5b2be9f
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Jun 21, 2022
78d82a9
Update module.audio.ogg.php
JamesHeinrich Jul 6, 2022
59439c5
Quicktime add hvc1 / H.265 video codec
JamesHeinrich Jul 16, 2022
45f20fa
v1.9.22-202207161647 changelog
JamesHeinrich Sep 29, 2022
7e717e5
Update actions/checkout to v3
StudioMaX Oct 26, 2022
4f9133e
Remove deprecated utf8_encode/utf8_decode
StudioMaX Oct 27, 2022
4f23aee
Upgrade PHPStan to v1.8.11
StudioMaX Oct 27, 2022
0201903
Merge pull request #400 from JamesHeinrich/StudioMaX-actions-checkout
JamesHeinrich Oct 27, 2022
f5c964f
Merge pull request #402 from StudioMaX/utf8-deprecated
JamesHeinrich Oct 27, 2022
273e476
Guard against division by zero
tstarling Nov 14, 2022
c26c136
Fix incorrect division in module.audio-video.ivf.php
tstarling Nov 14, 2022
ce38a25
Merge pull request #404 from tstarling/division-by-zero
JamesHeinrich Nov 15, 2022
a61d9c5
#407
JamesHeinrich Jan 13, 2023
2ed7937
basic .7z (7-zip) format detection
JamesHeinrich Feb 10, 2023
dbfce30
Fix for MPEG-1 video pixel aspect ratio
bvibber Feb 15, 2023
4c46eb6
Apply common adjustments to MPEG-1 video capture aspect ratios
bvibber Feb 15, 2023
812c592
See if php static analysis likes this guard better
bvibber Feb 15, 2023
8f88da9
Trying to please static analysis
bvibber Feb 15, 2023
a0a8edc
Still trying to please static analysis
bvibber Feb 15, 2023
5756928
Merge pull request #411 from brion/mpeg1-aspect
JamesHeinrich Feb 15, 2023
1fdd050
One more attempt to please the static analyzer
bvibber Feb 15, 2023
1ef2a55
Merge pull request #412 from brion/mpeg1-aspect
JamesHeinrich Feb 15, 2023
4efd6d7
#413 Quicktime only use 'mp4a' for extracted audio metadata
JamesHeinrich Mar 31, 2023
ce4a159
#414 Bit rate for MP4 audio tracks
JamesHeinrich Apr 5, 2023
9a35092
#414 variable name typos
JamesHeinrich Apr 5, 2023
e738a00
#414 use quicktime_read_mp4_descr_length, remove quicktime_readESsize
JamesHeinrich Apr 5, 2023
e3b69ad
id3v2 IsANumber
JamesHeinrich May 29, 2023
9993caa
gCL references
JamesHeinrich Jul 5, 2023
cba30f6
#418 fread length error in XMP
JamesHeinrich Aug 8, 2023
83cd765
Run lint against PHP 8.3
StudioMaX Aug 10, 2023
f34219f
Merge pull request #420 from StudioMaX/gh-actions-php83
JamesHeinrich Aug 10, 2023
6a8cc00
#419 Quicktime undefined index: time_scale
JamesHeinrich Aug 10, 2023
c873cdc
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Aug 10, 2023
b98030e
move jpeg segments names from $GLOBALS to class static property
micheleorselli Sep 1, 2023
940d50f
Merge pull request #421 from micheleorselli/remove_global_in_favor_of…
JamesHeinrich Sep 1, 2023
69fe0c1
Update module.audio-video.riff.php
aonamrata Oct 16, 2023
41458f0
Merge pull request #423 from aonamrata/commentdata-notice
JamesHeinrich Oct 16, 2023
06c7482
changelog v1.9.23-202310190849
JamesHeinrich Oct 19, 2023
a300844
Quicktime missing tags on second scan
JamesHeinrich Nov 4, 2023
58b883d
#429 libxml_disable_entity_loader is deprecated
JamesHeinrich Nov 10, 2023
19c9d00
#430 RIFF only return comment string up to first null
JamesHeinrich Dec 30, 2023
2622a43
do not crash on empty seconds in DSS module
jmper Feb 1, 2024
23e4a2c
Merge pull request #434 from jmper/dsstimestamps
JamesHeinrich Feb 1, 2024
448085f
Compatibility fix for PHP 5.3
StudioMaX Feb 1, 2024
86e78ed
Update deprecated actions/checkout; lint against PHP 8.4
StudioMaX Feb 1, 2024
3bcea90
Merge pull request #435 from StudioMaX/php53fix
JamesHeinrich Feb 1, 2024
c9271a6
Merge pull request #436 from StudioMaX/gh-actions
JamesHeinrich Feb 1, 2024
e0e49e2
Upgrade PHPStan to v1.10.57
StudioMaX Feb 2, 2024
fff2dc3
Merge pull request #437 from StudioMaX/update-phpstan
JamesHeinrich Feb 2, 2024
a94fb70
#438 basic GPX format detection
JamesHeinrich Feb 19, 2024
449956e
APE 32-bit PHP warning
JamesHeinrich Mar 23, 2024
143af33
#440 Mpeg duration error due to error in GOP parsing
JamesHeinrich Mar 26, 2024
1192b61
#442 Warning on PrintHexBytes function when $string is not a string
JamesHeinrich Apr 26, 2024
d0e347f
#444 ID3v2 Uninitialized string offset 0
JamesHeinrich May 20, 2024
371330a
add demos
jasonvarga Jun 6, 2024
6415492
Merge pull request #445 from jasonvarga/demos-gitattributes
JamesHeinrich Jun 6, 2024
a1785af
#446 reflected XSS
JamesHeinrich Jul 29, 2024
27da383
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Jul 29, 2024
c4f10f7
#449 Lyrics3 did not respect option_tag_apetag
JamesHeinrich Aug 6, 2024
3a59f2e
#450 Ogg wrong duration
JamesHeinrich Aug 8, 2024
969fa78
Add dependabot config
jrfnl Sep 9, 2024
701f124
Merge pull request #453 from jrfnl/feature/add-dependabot
JamesHeinrich Sep 9, 2024
16ec3c4
GH Actions: Bump ramsey/composer-install from 2 to 3
dependabot[bot] Sep 9, 2024
421324d
Merge pull request #454 from JamesHeinrich/dependabot/github_actions/…
JamesHeinrich Sep 9, 2024
48b3ded
PHPStan: move CLI options to config
jrfnl Sep 11, 2024
0f8f08e
PHPStan: update to latest version
jrfnl Sep 11, 2024
78dc28a
Merge pull request #455 from jrfnl/feature/update-phpstan
JamesHeinrich Sep 11, 2024
ded8b13
#452 Quicktime stsd atom parsing offsets
JamesHeinrich Sep 20, 2024
eb358a0
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Sep 20, 2024
39e5f54
#458 errors with MP3 free-format
JamesHeinrich Nov 19, 2024
a138b73
GH Actions: PHP 8.4 has been released
jrfnl Nov 22, 2024
054bb63
Merge pull request #459 from jrfnl/feature/ghactions-update-for-php-8…
JamesHeinrich Nov 22, 2024
8e5edc0
#460 DSS division by zero
JamesHeinrich Nov 22, 2024
4be7d4f
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Nov 22, 2024
224468d
#462 HEIF image support
JamesHeinrich Jan 7, 2025
290b5d6
#463 warning on null description
JamesHeinrich Jan 16, 2025
bb8f548
TAR: allow duplicate filenames
JamesHeinrich Feb 2, 2025
9957231
Update demo.cache.dbm.php
tapsystem Feb 12, 2025
4d633c6
Merge pull request #464 from tapsystem/patch-1
JamesHeinrich Feb 13, 2025
2f853e4
Update extension.cache.dbm.php
sabinich Mar 23, 2025
966910a
Merge pull request #1 from sabinich/sabinich-patch-1
sabinich Mar 23, 2025
9f83bdd
Merge pull request #466 from sabinich/master
JamesHeinrich Mar 23, 2025
0f1bccd
Change type casting from double to float
TobiasBg Aug 25, 2025
8cb2923
Merge pull request #469 from TobiasBg/patch-1
JamesHeinrich Sep 2, 2025
dbda40d
The backtick (`) operator is deprecated, use shell_exec() instead
StudioMaX Aug 25, 2025
70f7ca7
Fix PHPStan warnings
StudioMaX Aug 25, 2025
4a586c4
Merge pull request #470 from StudioMaX/php85-deprecations
JamesHeinrich Sep 3, 2025
0e6b86e
GH Actions: Bump actions/checkout from 4 to 5
dependabot[bot] Sep 3, 2025
4b9ba2c
Merge pull request #467 from JamesHeinrich/dependabot/github_actions/…
JamesHeinrich Sep 3, 2025
aed553b
#468 WAV files with RIFF and data chunk sizes of zero
JamesHeinrich Sep 4, 2025
478aa14
Quicktime com.android.capture.fps
JamesHeinrich Sep 4, 2025
1e11b9b
changelog v1.9.24-202509040923
JamesHeinrich Oct 9, 2025
164c78b
#452 Quicktime incorrect "keys" mapping
JamesHeinrich Oct 15, 2025
08a8614
Quicktime add "sgpd", "sbgp" atoms
JamesHeinrich Oct 15, 2025
59abfe6
#474 WriteMetaFLAC fails on new files on Windows
JamesHeinrich Oct 15, 2025
638be01
#452 handle ISO639-2/T Quicktime language code
JamesHeinrich Oct 16, 2025
3c7e76b
#452 better handle some Quicktime metadata
JamesHeinrich Oct 17, 2025
1e964b1
IVF fix warnings, improve framerate
JamesHeinrich Oct 23, 2025
72909ca
GH Actions: Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
96b6b00
Merge pull request #475 from JamesHeinrich/dependabot/github_actions/…
JamesHeinrich Nov 24, 2025
a56ab68
ID3v2 errors with ord()
JamesHeinrich Nov 30, 2025
368bcdc
Merge branch 'master' of https://github.com/JamesHeinrich/getID3
JamesHeinrich Nov 30, 2025
4a09bdb
int conversion warning in PHP8.5
JamesHeinrich Dec 16, 2025
35bda64
PHP8.5 compatibility
JamesHeinrich Dec 16, 2025
b03f514
Add PHP_INT_MIN for PHP older than 5.6
StudioMaX Dec 17, 2025
879a501
Merge pull request #478 from StudioMaX/php56-int-min
JamesHeinrich Dec 17, 2025
b0f85d5
Update README.md
JamesHeinrich Dec 17, 2025
4d4fdf4
Update getid3.lib.php
JamesHeinrich Dec 17, 2025
a874b8c
Standardize indentation whitespace
JamesHeinrich Dec 17, 2025
c234398
xml_parser_free deprecated in PHP8.5
JamesHeinrich Jan 3, 2026
56a0c11
intValueSupported edge cases
JamesHeinrich Jan 3, 2026
edafafd
QT skip comment copy on empty data
JamesHeinrich Jan 8, 2026
6696cfb
Allow metadata extraction from streamable FLAC files
hartman Jan 13, 2026
d721d36
ID3v1 should not parse files shorter than 128 bytes
hartman Jan 16, 2026
1b4d86d
MIDI: Fix duration for files without tempo events
hartman Jan 16, 2026
113d359
MIDI: Check for minimum filessize of a valid MIDI header
hartman Jan 16, 2026
4bf44f6
Merge pull request #481 from wikimedia/upstream/shortfiles
JamesHeinrich Jan 16, 2026
28a98cc
Merge pull request #482 from wikimedia/upstream/midi-duration
JamesHeinrich Jan 16, 2026
d906224
Merge pull request #483 from wikimedia/upstream/midi-header-validation
JamesHeinrich Jan 16, 2026
facddd9
Merge pull request #480 from wikimedia/upstream/flac-streamable-duration
JamesHeinrich Jan 16, 2026
d0e221b
Stop calling imagedestroy in PHP8+
ZabeMath Jan 21, 2026
3dbb6b9
Matroska: scan for duration when not provided by metadata
hartman Jan 20, 2026
f82f375
Use an internal scan state variable
hartman Jan 26, 2026
48450b2
Matroska: Handle missing TrackUID
hartman Jan 26, 2026
76a99b4
Merge pull request #484 from ZabeMath/master
JamesHeinrich Feb 6, 2026
2c655d6
Merge pull request #485 from wikimedia/upstream/matroska-duration-scan
JamesHeinrich Feb 6, 2026
53a9a79
Merge pull request #487 from wikimedia/upstream/partial_webm_file
JamesHeinrich Feb 6, 2026
61f6fce
#486 WAV.PCM detected as WAV.MP3
JamesHeinrich Feb 6, 2026
ac9fa75
#486 null coalescing operator not available in PHP5
JamesHeinrich Feb 7, 2026
76758f6
fix: GPS computed timestamp ignoring date due to array reinitialization
NewEXE Mar 8, 2026
baf1ae0
Merge pull request #488 from NewEXE/master
JamesHeinrich Mar 8, 2026
5c68152
XML XXE
JamesHeinrich Mar 8, 2026
fefffe7
changelog 1.9.25-202603060942
JamesHeinrich Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ Doxyfile export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
tests/ export-ignore
demos/ export-ignore
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Dependabot configuration.
#
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "GH Actions:"
26 changes: 19 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
lint:
name: "Lint"
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
Expand All @@ -21,27 +22,38 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
experimental:
- false
include:
- php-version: "8.5"
experimental: true
composer-options: "--ignore-platform-reqs"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v6"
- uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
ini-values: error_reporting=-1, display_errors=On
coverage: "none"
- uses: "ramsey/composer-install@v1"
- uses: "ramsey/composer-install@v3"
with:
composer-options: "${{ matrix.composer-options }}"
- name: "Run the linter"
run: "composer lint -- --colors"

static-analysis:
name: "Static Analysis"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v6"
- uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
tools: "phpstan:0.12.99"
php-version: "8.4"
tools: "phpstan:2.1.22"
coverage: "none"
- uses: "ramsey/composer-install@v1"
- uses: "ramsey/composer-install@v3"
- name: "Run PHPStan"
run: "phpstan analyse -c phpstan.neon -l 4 getid3"
run: "phpstan"
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ getID3() is released under multiple licenses. You may choose from the following

**getID3 Commercial License:**

* [gCL](https://www.getid3.org/#gCL) (payment required)
* [gCL](https://www.getid3.org/#gCL) (no longer available, existing licenses remain valid)

* * *
Copies of each of the above licenses are included in the `licenses/`
Expand Down Expand Up @@ -125,7 +125,7 @@ Reads & parses (to varying degrees):
* SWF (Flash)
* PhotoCD

+ data:
+ data:
* ISO-9660 CD-ROM image (directory structure)
* SZIP (limited support)
* ZIP (directory structure)
Expand All @@ -146,13 +146,22 @@ Reads & parses (to varying degrees):
Requirements
===

* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier)
* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up)
* PHP 5.0.5 (or higher) for getID3() 2.0.x (and up)
* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier)
* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up)
* PHP 5.3.0 (or higher) for getID3() 1.9.17 (and up)
* PHP 5.3.0 (or higher) for getID3() 2.0.x (and up)
* at least 4MB memory for PHP. 8MB or more is highly recommended.
12MB is required with all modules loaded.

Installation
===
The preferred method is via [composer](https://getcomposer.org/). Follow the installation [instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

```
composer require james-heinrich/getid3
```

Usage
===
Expand Down Expand Up @@ -289,7 +298,7 @@ could essentially write it today with a one-line function:

``` php
function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); }

```


Expand Down
81 changes: 81 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,87 @@
Version History
===============

1.9.25: [2026-03-10] James Heinrich :: 1.9.25-202603060942
* #452 better handle some Quicktime metadata
* #452 handle ISO639-2/T Quicktime language code
* #452 Quicktime incorrect "keys" mapping
* #474 WriteMetaFLAC fails on new files on Windows
* #476 ID3v2 errors with ord()
* #477 int conversion warning in PHP8.5
* #477 QT skip comment copy on empty data
* #480 allow metadata extraction from streamable FLAC files
* #481 ID3v1 should not parse files shorter than 128 bytes
* #482 MIDI: Fix duration for files without tempo events
* #483 MIDI: Check for minimum filessize of a valid MIDI header
* #484 stop calling imagedestroy in PHP8+
* #485 Matroska: scan for duration when not provided by metadata
* #486 null coalescing operator not available in PHP5
* #486 WAV.PCM detected as WAV.MP3
* #487 Matroska: Handle missing TrackUID
* #488 GPS computed timestamp ignoring date
* XML XXE
* add PHP_INT_MIN for PHP older than 5.6
* IVF fix warnings, improve framerate
* xml_parser_free deprecated in PHP8.5

1.9.24: [2025-10-09] James Heinrich :: 1.9.24-202509040923
» #462 add HEIF image support
» #438 add detection support .gpx files
* #470 PHP8.5 compatibility
* #468 WAV files with RIFF and data chunk sizes of zero
* #463 warning on null description
* #460 DSS division by zero
* #458 errors with MP3 free-format
* #452 incorrect parsing of Quicktime files
* #450 ogg file formats wrong duration
* #449 Lyrics3 did not respect option_tag_apetag
* #444 ID3v2 ininitialized string offset 0
* #442 PrintHexBytes warning when $string is not a string
* #440 MPEG duration error due to error in GOP parsing
* #435 compatibility fix for PHP 5.3
* #434 do not crash on empty seconds in DSS module
* #430 garbage extracted from a RIFF tag in an AIFF file
* #429 libxml_disable_entity_loader is deprecated
* quicktime parse com.android.capture.fps
* tar allow duplicate filenames

1.9.23: [2023-10-19] James Heinrich :: 1.9.23-202310190849
» add detection support for 7-zip archives
* #424 RIFF Undefined index "data"
* #421 tag.xmp remove GLOBALS
* #419 Quicktime Undefined index "time_scale"
* #418 tag.xmp zero-length fread
* #414 Quicktime bitrate for mp4 audio
* #413 Quicktime audio metadata
* #410 MPEG-1 pixel aspect ratio
* #407 PHP 8.1 compatibility
* #404 guard against division by zero
* #402 remove utf8_encode/utf8_decode

1.9.22: [2022-09-29] James Heinrich :: 1.9.22-202207161647
* bugfix #387 fails to detect h265 video codec (QuickTime)
* bugfix #385 Quicktime extended atom size
* bugfix #378 AAC bitrate cache warning
* bugfix #376 simplexml_load_string improvments
* bugfix #374 MOD improved SoundTracker support
* bugfix #371 fragmented MP4 unsupported warning
* bugfix #369 fix remote URLs pattern
* bugfix #366 change @error-suppress to isset (quicktime)
* bugfix #365 ZIP array offset on value of type int
* bugfix #364 add support for ANIMEXTS1.0 in GIF files
* bugfix #363 ASF improve support of Header Extension Object data
* bugfix #362 version update for ramsey/composer-install
* bugfix #359 MPEG-2 aspect ratio divide-by-zero
* bugfix #358 free format mp3 bitrate
* bugfix #355 undefined array key in ID3v2 chapters
* bugfix #352 avoid false detection of Musepack format
* bugfix #351 Incorrect length passed to fread on a flac file
* bugfix #348 more targeted usage of clearstatcache calls
* bugfix #347 fixed reported by PHPStan v0.12.99
* bugfix QuickTime support 'ID32' frame (ID3v2 inside QT)
* bugfix fix various PHP 8.1 issues
* bugfix PDF prevent undefined index

1.9.21: [2021-09-22] James Heinrich :: 1.9.21-202109171300
» add support for RIFF.guan
¤ add ID3v1 genres 148-191
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ext-zlib": "Zlib extension is required for archive modules and compressed metadata."
},
"scripts": {
"lint": "parallel-lint --exclude vendor --exclude .git .",
"lint": "parallel-lint --show-deprecated --exclude vendor --exclude .git .",
"test": [
"composer lint"
]
Expand Down
6 changes: 3 additions & 3 deletions demos/demo.browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
if (isset($_REQUEST['filename'])) {

if (!file_exists($_REQUEST['filename']) || !is_file($_REQUEST['filename'])) {
die(getid3_lib::iconv_fallback($FileSystemEncoding, $PageEncoding, $_REQUEST['filename'].' does not exist'));
die(htmlentities(getid3_lib::iconv_fallback($FileSystemEncoding, $PageEncoding, $_REQUEST['filename'].' does not exist')));
}
$starttime = microtime(true);

Expand Down Expand Up @@ -116,7 +116,7 @@
$listdirectory = str_replace(DIRECTORY_SEPARATOR, '/', $listdirectory.'/');
}

if (preg_match('#^(ht|f)tp://#', $_REQUEST['filename'])) {
if (preg_match('#^(ht|f)tps?://#', $_REQUEST['filename'])) {
echo '<i>Cannot browse remote filesystems</i><br>';
} else {
echo 'Browse: <a href="'.htmlentities($_SERVER['PHP_SELF'].'?listdirectory='.urlencode($listdirectory), ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'">'.getid3_lib::iconv_fallback($FileSystemEncoding, $PageEncoding, $listdirectory).'</a><br>';
Expand Down Expand Up @@ -469,7 +469,7 @@ function table_var_dump($variable, $wrap_in_td=false, $encoding='') {
global $FileSystemEncoding;
$encoding = ($encoding ? $encoding : $FileSystemEncoding);
$returnstring = '';
switch (gettype($variable)) {
switch (strtolower(gettype($variable))) {
case 'array':
$returnstring .= ($wrap_in_td ? '<td>' : '');
$returnstring .= '<table class="dump" cellspacing="0" cellpadding="2">';
Expand Down
1 change: 1 addition & 0 deletions demos/demo.cache.dbm.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@


require_once('../getid3/getid3.php');
require_once('../getid3/getid3.lib.php');
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'extension.cache.dbm.php', __FILE__, true);

$getID3 = new getID3_cached_dbm('db3', '/zimweb/test/test.dbm', '/zimweb/test/test.lock');
Expand Down
4 changes: 2 additions & 2 deletions demos/demo.dirscan.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function getDirs($root) {
break;
default: // scan 4 directories deep
if (!is_dir($root)) {
return null;
return null;
}
$dirs = array_merge(glob($root.'/*', GLOB_ONLYDIR), glob($root.'/*/*', GLOB_ONLYDIR), glob($root.'/*/*/*', GLOB_ONLYDIR), glob($root.'/*/*/*/*', GLOB_ONLYDIR), glob($root.'/*/*/*/*/*', GLOB_ONLYDIR), glob($root.'/*/*/*/*/*/*', GLOB_ONLYDIR), glob($root.'/*/*/*/*/*/*/*', GLOB_ONLYDIR));
break;
Expand Down Expand Up @@ -216,7 +216,7 @@ function scan_files($dir, $match, $cache='sqlite3', $opt=array('table'=>'getid3_
echo ' Scanning: '.$d."\n";
$search = self::type_brace($d, $match);
if ($search !== null) {
$files = self::file_check($search);
$files = self::file_check($search);
if ($files !== null) {
foreach ($files as $f) {
echo ' * Analyzing '.$f.' '."\n";
Expand Down
61 changes: 29 additions & 32 deletions demos/demo.mp3header.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
break;

case 3: // UTF-8 encoded Unicode. Terminated with $00.
$asciidata = utf8_decode($rawdata);
$asciidata = utf8_to_iso8859_1($rawdata);
break;

case 255: // Unicode, Big-Endian. Terminated with $00 00.
Expand Down Expand Up @@ -929,43 +929,40 @@ function image_type_to_mime_type($imagetypeid) {
}
}

if (!function_exists('utf8_decode')) {
// PHP has this function built-in if it's configured with the --with-xml option
// This version of the function is only provided in case XML isn't installed
function utf8_decode($utf8text) {
// http://www.php.net/manual/en/function.utf8-encode.php
// bytes bits representation
// 1 7 0bbbbbbb
// 2 11 110bbbbb 10bbbbbb
// 3 16 1110bbbb 10bbbbbb 10bbbbbb
// 4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb

$utf8length = strlen($utf8text);
$decodedtext = '';
for ($i = 0; $i < $utf8length; $i++) {
if ((ord($utf8text[$i]) & 0x80) == 0) {
$decodedtext .= $utf8text[$i];
} elseif ((ord($utf8text[$i]) & 0xF0) == 0xF0) {
$decodedtext .= '?';
$i += 3;
} elseif ((ord($utf8text[$i]) & 0xE0) == 0xE0) {
function utf8_to_iso8859_1($utf8text) {
// http://www.php.net/manual/en/function.utf8-encode.php
// bytes bits representation
// 1 7 0bbbbbbb
// 2 11 110bbbbb 10bbbbbb
// 3 16 1110bbbb 10bbbbbb 10bbbbbb
// 4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb

$utf8length = strlen($utf8text);
$decodedtext = '';
for ($i = 0; $i < $utf8length; $i++) {
if ((ord($utf8text[$i]) & 0x80) == 0) {
$decodedtext .= $utf8text[$i];
} elseif ((ord($utf8text[$i]) & 0xF0) == 0xF0) {
$decodedtext .= '?';
$i += 3;
} elseif ((ord($utf8text[$i]) & 0xE0) == 0xE0) {
$decodedtext .= '?';
$i += 2;
} elseif ((ord($utf8text[$i]) & 0xC0) == 0xC0) {
// 2 11 110bbbbb 10bbbbbb
$decodedchar = Bin2Dec(substr(Dec2Bin(ord($utf8text[$i])), 3, 5).substr(Dec2Bin(ord($utf8text[($i + 1)])), 2, 6));
if ($decodedchar <= 255) {
$decodedtext .= chr($decodedchar);
} else {
$decodedtext .= '?';
$i += 2;
} elseif ((ord($utf8text[$i]) & 0xC0) == 0xC0) {
// 2 11 110bbbbb 10bbbbbb
$decodedchar = Bin2Dec(substr(Dec2Bin(ord($utf8text[$i])), 3, 5).substr(Dec2Bin(ord($utf8text[($i + 1)])), 2, 6));
if ($decodedchar <= 255) {
$decodedtext .= chr($decodedchar);
} else {
$decodedtext .= '?';
}
$i += 1;
}
$i += 1;
}
return $decodedtext;
}
return $decodedtext;
}


if (!function_exists('DateMac2Unix')) {
function DateMac2Unix($macdate) {
// Macintosh timestamp: seconds since 00:00h January 1, 1904
Expand Down
26 changes: 13 additions & 13 deletions demos/getid3.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,22 @@ td.dump_boolean {
*/

.tooltip {
font: 9pt sans-serif;
background: #ffffe1;
color: black;
border: black 1px solid;
margin: 2px;
padding: 7px;
position: absolute;
top: 10px;
left: 10px;
z-index: 10000;
visibility: hidden;
font: 9pt sans-serif;
background: #ffffe1;
color: black;
border: black 1px solid;
margin: 2px;
padding: 7px;
position: absolute;
top: 10px;
left: 10px;
z-index: 10000;
visibility: hidden;
}

.tooltip p {
margin-top: -2px;
margin-bottom: 4px;
margin-top: -2px;
margin-bottom: 4px;
}


Expand Down
Loading