JamesHeinrich / getID3

http://www.getid3.org/
Other
1.13k stars 245 forks source link

Deprecated: Implicit conversion from float ... to int loses precision #439

Closed janui closed 3 months ago

janui commented 3 months ago

Hello there,

I ran into the following messages: Deprecated: Implicit conversion from float 2684354560 to int loses precision in /srv/http/app/libs/vendor/james-heinrich/getid3/getid3/module.tag.apetag.php on line 396 Deprecated: Implicit conversion from float 2684354560 to int loses precision in /srv/http/app/libs/vendor/james-heinrich/getid3/getid3/module.tag.apetag.php on line 397 Deprecated: Implicit conversion from float 2684354560 to int loses precision in /srv/http/app/libs/vendor/james-heinrich/getid3/getid3/module.tag.apetag.php on line 398 Deprecated: Implicit conversion from float 2147483648 to int loses precision in /srv/http/app/libs/vendor/james-heinrich/getid3/getid3/module.tag.apetag.php on line 394

getID3 was cloned from your repo on 21-03-2024

PHP version info: PHP 8.2.7 (cli) (built: Jul 20 2023 18:02:54) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.7, Copyright (c) Zend Technologies with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

Linux version info: Linux 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" NAME="Raspbian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)"

janui

JamesHeinrich commented 3 months ago

A small sample file that shows this behaviour would be appreciated for testing. You can post here or email to info@getid3.org if you don't want it public.

JamesHeinrich commented 3 months ago

What is the value of PHP_INT_MAX in your PHP?

(echo PHP_INT_MAX; should give either 9223372036854775807 or 2147483647)

janui commented 3 months ago

PHP_INT_MAX is 2147483647

janui commented 3 months ago

A testfile has been sent to info@getid3.org

JamesHeinrich commented 3 months ago

If your PHP/OS is 32-bit then it's no surprise that some things don't work quite right. I'm not sure if there's a sensible solution. I mean, the code can be rewritten at the expense of speed or complexity, but I'm not sure I want to do that for the edge case of a 32-bit PHP installation.

JamesHeinrich commented 3 months ago

If you only use APE tags in your files for MP3gain information and most of the data is stored in ID3v2, and you don't need mp3gain info in the returned data, then you could simply skip APE processing with $getID3->setOption(array('option_tag_apetag' => false));

janui commented 3 months ago

$getID3->setOption(array('option_tag_apetag' => false)); This is just what I need for my 32-bit version. I use getID3 primarily for retrieval of album art images. This will be fine. Thanks