JamesHeinrich / getID3

http://www.getid3.org/
Other
1.14k stars 244 forks source link

special char in filename gives filesize error in big file #204

Open tissatussa opened 4 years ago

tissatussa commented 4 years ago

I encounter an error when a file is big AND ALSO its filename has some special character : its filesize can not be determined by getID3. I conclude this after precise testing with several (video) files and filenames.

Eg. a video file named "Côte d’Ivoire.mp4" gives the following error : Notice: Undefined index: filesize in /var/www/projects/chess/show.php on line [..]

So, when the filename is "Côte d’Ivoire.mp4" and its filesize is small (eg. 20 Mb) the filesize CAN be determined, there's no error. When the filename is normal, like "Cote d'Ivoire.mp4", and its filesize is big (i tested with more than 3 Gb) the filesize ALSO CAN be determined, there's no error.


Array ( [GETID3_VERSION] => 1.9.18-201907240906 [filepath] => /mnt/data/vids [filename] => 2019 Côte d’Ivoire Rapid & Blitz - Rapid Rounds 4-6.mp4 [filenamepath] => /mnt/data/vids/2019 Côte d’Ivoire Rapid & Blitz - Rapid Rounds 4-6.mp4 [encoding] => UTF-8 [error] => Array ( [0] => Unable to determine actual filesize. File is most likely larger than 2GB and is not supported by PHP. ) )


Array ( [GETID3_VERSION] => 1.9.18-201907240906 [filesize] => 3176759057 [filepath] => /mnt/data/vids [filename] => 2019 Cote d'Ivoire Rapid & Blitz - Rapid Rounds 4-6.mp4 [filenamepath] => /mnt/data/vids/2019 Cote d'Ivoire Rapid & Blitz - Rapid Rounds 4-6.mp4 [avdataoffset] => 0 [avdataend] => -1118208239 [fileformat] => quicktime [warning] => Array ( [0] => File is larger than 2GB (filesystem reports it as 2.959GB) and is not properly supported by PHP. [1] => Unable to check for ID3v1 because file is larger than 2GB [2] => Unable to check for APEtags because file is larger than 2GB [3] => Unable to check for Lyrics3 because file is larger than 2GB ) [encoding] => UTF-8 [mime_type] => video/quicktime [quicktime] => Array ( [hinting] => [controller] => standard [encoding] => UTF-8 ) )


I'm an experienced (web)programmer. I use the latest getID3 release v1.9.18-201907240906.

JamesHeinrich commented 4 years ago

Solution: upgrade your PHP installation to 64-bit.

Assuming you're unable to do that, the fallback filesize-determining function is likely failing due to UTF-8 encoding issues. Perhaps you can do some debugging on the system call line and figure out how it's being called incorrectly: https://github.com/JamesHeinrich/getID3/blob/master/getid3/getid3.lib.php#L1736

JamesHeinrich commented 4 years ago

No response from original poster for 5 months, marking issue as closed.