[SOLVED] Thumbnail Generator Issue in 9.0.0 - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [SOLVED] Thumbnail Generator Issue in 9.0.0 (/showthread.php?tid=6506) |
RE: Thumbnail Generator Issue in 9.0.0 - Tim Curtis - 05-28-2024 (05-28-2024, 06:23 PM)ftw64 Wrote: Hi Tim, Back at the start of the Bookworm port I had to fixup some implode() statements in the id3 and iso14496 Zend classes that failed due to not being PHP8 compliant. Here's the commit https://github.com/moode-player/moode/commit/16d922e543a5bb3d7a41b19c9a178588c13af3a1 It' possible other non-php8-compliant code exists in Zend. Just a thought. RE: Thumbnail Generator Issue in 9.0.0 - ftw64 - 05-28-2024 (05-28-2024, 06:40 PM)Tim Curtis Wrote:(05-28-2024, 06:23 PM)ftw64 Wrote: Hi Tim, I'm absolutely unsure if what I'm doing is correct (have almost no knowledge of PHP). But when I change the implode code in /var/www/inc/Zend/Media/Id3/LinkFrame.php to the below, the thumbnail generator no longer crashes on the offending MP3 file: Code: public function __construct($reader = null, &$options = array()) However, now it fails on some FLAC other MP3 file... Perhaps there are other incorrect calls to implode in the Zend Framework... I'll continue debugging... -Frank RE: Thumbnail Generator Issue in 9.0.0 - ftw64 - 05-28-2024 Hi Tim, The other MP3 file fails in /var/www/util/thumb-gen.php line 168 (file_get_contents): Code: workerLog('thumb-gen: 10'); My log shows: Code: 20240528 211547 thumb-gen: 10 The function file_get_contents seems a PHP build-in function? Might be that getImage (using the Zend Framework) does not crash now, but returns an empty string. Would that cause file_get_contents to crash in PHP? Update: seems that imgStr contains binary date: 4 bytes of '0x00'. If I add '$image = false' to /var/www/util/thumb-gen.php near line 322 the thumbnail generator works fine: Code: case 'mp3': Seems another issue in Zend Framework ($id3v2->apic->imageData seems to contain four bytes of '0x00', confusing outImage() ? ) -Frank RE: Thumbnail Generator Issue in 9.0.0 - ftw64 - 05-28-2024 Hi Tim, I think this is as far as I can get with my poor knowledge of PHP. I have added this code to /var/www/util/thumb-gen.php near line 319; Code: workerLog('thumb-gen: getImage(): 5'); The last lines in moode.log read (when opening with vi to see the unprintable characters): Code: 20240528 215710 thumb-gen: getImage(): 5 After that, the thumbnail generator seems to crash in file_get_contents() at line 168: Code: if (strlen($imgStr) < 512) { Moode.log continues: Code: 20240528 215710 thumb-gen: 10 But never prints 'thumb-gen: 12'. I'm hoping for a solution as I really like MoOde Audio! It might be that the Zend Framework needs to be updated with PHP8? With best regards, -Frank RE: Thumbnail Generator Issue in 9.0.0 - Nutul - 05-28-2024 This seems not the way to go... It's either a malformed id3v2 tag (the Zend library should be fail-safe anyway...), or indeed the Zend library needs to be investigated more thoroughly for PHP8 compliancy. RE: Thumbnail Generator Issue in 9.0.0 - Tim Curtis - 05-28-2024 Nice catch on the implode. I'll fix for upcoming r901. I also checked the code base for other implodes and they all look correct. ETA: I'll look into the $image length issue based on your last post RE: Thumbnail Generator Issue in 9.0.0 - Nutul - 05-28-2024 Also, it could be that the Zend library is aware of the id3v2 tag up to version 3 (id3v2.3) and your files are tagged with version 4 (id3v2.4) Just speculating here, cannot be sure; but as I discovered some inconsistencies in the Zend library about the id3 tag hadling in the past, it could well be something related. You could try to check your files, and eventually try to convert the tag to version 3 (some tools, like kid3, can do it) and see if the problem gets solved. Of course, if this is the case we can always "fix" the Zend library; but sometime in the future... ;-) RE: Thumbnail Generator Issue in 9.0.0 - TheOldPresbyope - 05-28-2024 Sorry I've been MIA on this issue. Got a health scare soon after I downloaded the MP3 file from the OP (@haeckse ) and I've been spending time in waiting rooms . [To quote my grandmoter, who stole it from someone else I'm sure, "growing old is not for sissies." Oh well, it beats the alternative.] As I read through @ftw64 's adventure digging in the bowels of Zend, I'm reminded that I found curiosities with the file jup.mp3. One is that it does not contain an APIC frame. The embedded coverart is apparently contained in a second MPEG stream. As well, outout of various tools such as ffprobe Code: ... and mp3diags Code: ... A side effect of this is that my moOde 9.0.0. player doesn't display either a thumbnail or the full cover. I haven't had time to explore removing the second stream and writing the coverart instead in an APIC frame. Regards, RE: Thumbnail Generator Issue in 9.0.0 - TheOldPresbyope - 05-28-2024 Sorry I've been MIA on this issue. Got a health scare soon after I downloaded the MP3 file from the OP (@haeckse ) and I've been spending time in waiting rooms . [To quote my grandmoter, who stole it from someone else I'm sure, "growing old is not for sissies." Oh well, it beats the alternative.] As I read through @ftw64 's adventure digging in the bowels of Zend, I'm reminded that I found curiosities with the file jup.mp3. One is that it does not contain an APIC frame. The embedded coverart is apparently contained in a second MPEG stream. As well, outout of various tools such as ffprobe Code: ... and mp3diags Code: ... A side effect of this is that my moOde 9.0.0. player doesn't display either a thumbnail or the full cover. I haven't had time to explore removing the second stream and writing the coverart instead in an APIC frame. Regards, Kent RE: Thumbnail Generator Issue in 9.0.0 - Tim Curtis - 05-28-2024 (05-28-2024, 08:06 PM)ftw64 Wrote: Hi Tim, It looks like nulls and any other bad data in the path arg for file_get_contents() causes crash. Example: Crashing the php shell. Code: php > $tim = file_get_contents("\00"); The fix is to check for a valid file path instead of using the assumption in the "if: statement that if length is < 512 it must be a path and not actual image data. Code: if (strlen($imgStr) < 512) I'll fix for upcoming r901 |