Page 1 of 1

> 2GB support

Posted: Tue Apr 11, 2006 12:33 am
by nerolabs
Hello All --

I have a bunch of files I'm trying to analyze with getID3. Seems like the 2GB limit in PHP is strictly enforced in getID3.php, unless you edit the file to turn checking off for this with a configuration variable.

There are a couple resources I've found that says you can truly get php itself to support files larger than 2GB. Someone on a forum on php.net mentioned that you can recompile with CFLAGS="-D_FILE_OFFSET_BITS=64".

The second in this forum itself suggests that getID3 be given an option to just check the first 100KB or so of a file an the last 100KB or so of a file to get the information needed.

Any getID3 developers care to shed light on the issue? Just looking for the best way to support > 2GB files in my application.

thanks!

Nero

Posted: Mon May 01, 2006 12:42 pm
by Allan Hansen
1. You do no need to edit getid3.php in order to disable the 2Gb check:

$getid3 = new getID3();
$getid3->option_max_2gb_check = false;
$getid3->Analyze('file.flac');


2. Integers in PHP are signed 32 bit. There is no way to get PHP to ise 64 bit integers. This means all whle numbers in PHP are within the range +-2 billion. getID3() has no (or little) problems reading first and last part of the file, but all calculations involving the filesize will be flawed. This is usually bitrate and sometimes playtime. Nothing we can do to avoid this problem.

Posted: Mon Jan 15, 2007 4:19 pm
by macondos
Index: getid3.php
===================================================================
// set parameters
- $this->info['filesize'] = filesize($filename);
+ $this->info['filesize'] = sprintf("%u", filesize($filename));

Limit increase to 4 GB