Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Cover images not loaded for all albums
#27
(05-11-2023, 08:12 PM)Nutul Wrote:
(05-11-2023, 07:18 PM)haeckse Wrote: OTHER Image: [Size: 50435 bytes] [Type: image/jpeg]
FRONT_COVER Image: [Size: 260249 bytes] [Type: image/JPEG]
FRONT_COVER Image: [Size: 58684 bytes] [Type: image/PNG]
(...)
I have no idea about the complexity yet, but maybe it's worth investing some time diving into the Moode code to understand how and where the ID3 data is processed. Maybe I can manage to make the parser more fault-tolerant in dealing with messy metadata, which will probably be more fun than plodding through fixing the bad tags : )

See my previous post.

OTHER Image should work because the APIC frame parser is not so strict to look for specific pictures (I am not sure, but in case many APIC frames are present, the first one will be returned... whatever its type is). I am a bit rusty on PHP, but I understand the following code adds an entry to an array:

$this->_frames[$frame->getIdentifier()][] = $frame
;

so that $this->_frames['APIC'] is an array of all the 'APIC' frames found in the id3v2 tag.

id3v2->apic (which is what the moOde's image handler looks for) is a proxied method retriever that looks into the frame IDs, and it returns the FIRST frame with such ID ('apic') converted to all capitals:

Code:
public function __get($name)
{
  if (!empty($this->_frames[strtoupper($name)])) {
          return $this->_frames[strtoupper($name)][0];
      }

the mixed case mime types image/PNG, or image/JPEG, won't work because moOde's thumbnail generator / image extractor checks the MIME type against lowercase strings only, e.g. 'image/png', 'image/jpeg', etc.


Maybe I confused myself somehow in my tests regarding the "other image" issue. I will rerun my tests tomorrow.

As for the MIME-type problem, it's nice that you found the root cause, which seemingly can be solved relatively easily. Thanks for looking into the code and the explanation! 

Regards,
Andrea
Reply


Messages In This Thread
RE: Cover images not loaded for all albums - by haeckse - 05-11-2023, 09:50 PM

Forum Jump: