losnoco / Cog

Cog - A Free and Open Source Audio Player for macOS 10.13+
https://cog.losno.co
GNU General Public License v2.0
695 stars 45 forks source link

No embedded art support for FLAC #159

Closed brianjdoherty closed 2 years ago

brianjdoherty commented 3 years ago

Describe No album art in Info Inspector window with FLAC files

To Reproduce Steps to reproduce the behavior:

  1. Open folder with FLAC files
  2. Click on one of the files
  3. Hit "i" button on toolbar to open inspector
  4. See gray square instead of album art.
  5. Try the same sequence with MP3 or MP4 files - art is visible.

Expected behavior Album art should be visible for FLAC files just as it is for MP3 files.

**Version information:***

Additional context The FLAC files do have album art embedded in them. The art is visible in the Meta app, and also in the Doppler iOS music player. Some FLAC files are ripped from CD with fre:ac, others are purchased from Qobuz. Same behavior.

kode54 commented 3 years ago

This should be implemented now, and there is also now a handy Reload tags action in the Playlist context menu so you don't need to remove and re-add the affected tracks.

brianjdoherty commented 3 years ago

That was fast! Thanks - works now. :-)

NattyNarwhal commented 3 years ago

Nice! I was curious about this, but I was assuming it was reading metadata from the Apple APIs, since I don't see embedded album art in FLACs from Apple apps either.

kode54 commented 3 years ago

Nope, it's using TagLib, and it only currently supports MP3, MP4, Ogg files (possibly Opus too with that), and now FLAC.

NattyNarwhal commented 3 years ago

Good to know; I was missing it for a while and assumed it'd have to involve something crazy. My only nitpicks are just capitalization of the new menu item, the fact it should probably exist in the menu bar as well, and the fact it didn't update the album art on a currently playing track, at least for MPIC/the info inspector toolbar button. But that's all pretty minor.

brianjdoherty commented 3 years ago

I'm not a developer, but I have noticed that MacOS does know what a FLAC file is:

$ file 01\ -\ Steve\ Miller\ Band\ -\ The\ Joker.flac 01 - Steve Miller Band - The Joker.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 11756472 samples

But in the Finder it doesn't show album art for FLACs the way it does for MP3 files. I think they're pushing us to use AAC.

NattyNarwhal commented 3 years ago

file uses whatever magic database is in common use (probably taken from a BSD, I don't really know the provenance of it all). it doesn't do tag reading either, it's just reading the bare minimum low hanging fruit from the header. In the Apple case, I'm assuming they might have done FLAC for the sake of other things (perhaps Safari/WebKit) and don't really care about it otherwise.

nevack commented 3 years ago

QuickLook's .qlplugins are responsible for rendering previews. Some plugins are already there in macOS, some are provided by 3rd party apps.

kode54 commented 3 years ago

Why should it exist in the menubar? It affects the playlist selection, and none of the menu bar items do, except for what's in the Edit menu. Also, how should it be capitalized?

NattyNarwhal commented 3 years ago

I'll admit to looking in the menu bar first (even searching from Help) because that's the first place I look for commands in a Mac application. The "Playlist" menu contains a lot of the commands from the context menu already. Capitalization should be like the other things, i.e "Remove from Queue", "Reveal in Finder")

I might file a PR for it so you don't have to; I've been meaning to play with InterfaceBuilder :)