INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Problem with cover art in track info shown in display view when playing flac  (Read 3239 times)

mhakman

  • World Citizen
  • ***
  • Posts: 206

There is a problem with cover art in track info shown in display view when playing flac files with cover art embedded within the file. When playing files without embedded covert art, the symbol TRACKINFO_INSERT_IMAGE in a html template gets replaced by the actual absolute path to an image file. The image is then shown correctly. When a flac file contains embedded image (new for MC 12) then this symbol gets replaced with "flac_cover.jpg". However, MC generates this image file containing correct image on user’s desktop directory where it is not found when MC is displaying the generated html page. All MC provided track info templates behave this way.

Thanks/Mikael
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

Update: Above problem occurs only when flac files are stored on a server share and MC runs on another computer. When both the files and MC are on the same computer then TRACKINFO_INSERT_IMAGE is replaced by correct absolute image path in all cases.

Thanks/Mikael
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

I suspect, but haven't tried, that what you describe might be a problem for all formats, not just flac.  When the flac plugin is told to get the image from the file, it decodes it to a filename and returns the filename to MC.  MC then does whatever it needs to.  Seems like the computer running MC doesn't know anything about the path structure to where the file actually is.  I suppose it's possible for the plugin to return the entire path, but that wouldn't solve your problem since it would still return the drive name, which probably doesn't match across the network.
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

Well, it works all right on flac files stored using MC 11 then accessed from MC 12 on client (with cover art on file but not embedded). In this case TRACKINFO_INSERT_IMAGE gets replaced by full absolute path to the image file, including server share name. Also, in the problem case, MC 12 fetches the right image over the network and stores it in “flac_cover.jpg” file in client’s Desktop directory. This is also the name inserted into generated html instead of TRACKINFO_INSERT_IMAGE symbol. Only that nobody knows the file is on Desktop dir. Had the image been stored in html template dir then it would work – I tested this by manually copying the image. It looks like a bug somewhere.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

As the image handling functions of the decoder plugin are undocumented, I'm doing the best I can  ;D

I'm not sure what I can do to fix this.  The image is being decoded, but MC is putting it in the wrong location, or at least not referring to it correctly.  Maybe I am supposed to put it in a particular location, but I don't know it.  Looking at other plugins for which source is available and images were handled, I seem to be doing it correctly.
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

I don’t know all the details of what is being done by MC and plugin but I think the problem is within MC 12. Somehow it decides to fetch the image over the network. Whether it is using plugin to access embedded image or gets image directly from image file I don’t know. I have the image both on separate image file and embedded within flac file, both on server. Then MC stores that on client under the name “flac_cover.jpg” in Desktop dir. And then it replaces TRACKINFO_INSERT_IMAGE symbol with “flac_cover.jpg”. This file is not found when displaying html because Desktop is not “current” dir when html file is read and interpretted. Normally an image reference such as <img src="flac_cover.jpg"> refers to “flac_cover.jpg” on the directory from where the html file itself is read. Therefore MC should either place “flac_cover.jpg” on template dir or it should refer to the file in a proper way. The bug seems to be in MC 12.
Logged

aussie1

  • World Citizen
  • ***
  • Posts: 249
  • nothing more to say...

I have this problem too. However, it occurs when the flac files are stored on the same machine as MC. (The problem is not limited to server share situation).

TRACKINFO_INSERT_IMAGE successfully displays images imbedded in mp3 files. But it fails to display images imbedded in flac files. I'm using MC version 12.0.233 on Windows XP

S
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

I could try using the flac file name instead (your_song_name.jpg).  Or I could try returning the whole path instead of just the name.

As I mentioned above, I'm not 100% sure what MC is expecting.
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

The problem that I and apparently even Aussie1 has is that when cover image is embedded in an audio file (as opposed to being stored on a separate image file), MC fetches the image bits from audio file and stores them in a temporary image file on the disk.

For mp3 files MC names the image file “MP3 Image – nnnn.jpg” (nnnn is a sequence number) and places the file on your TEMP directory in JRTemp folder. Then it replaces the TRACKINFO_INSERT_IMAGE symbol in track info HTML template by full pathname of the temporary image, e.g. “C:\TEMP\JRTemp\MP3 Image - 3928.jpg" and displays the resulting HTML. HTML interpreter finds this file because it gets full pathname to the file.

For FLAC files MC names the image file “flac_cover.jpg” and places it on your desktop, e.g. on “C:\Documents and Settings\User\Desktop\” (User is name of the user actually logged into XP). Then MC replaces the TRACKINFO_INSERT_IMAGE symbol in track info HTML template by “flac_cover.jpg” (without the path) and displays the resulting HTML. Now, HTML interpreter cannot find the image file anymore because HTML rules say that a relative reference to a file (actually to an URL) is to be found on the same directory as where the HTML file itself comes from. HTML file comes from template directory, e.g. “C:\Program Files\J River\Media Center 12\Visualizations\Track Info\Template” (Template is name of the actual template to be used) whereas image file is on “C:\Documents and Settings\User\Desktop\”. Hence is the problem.

Therefore it appears it is the problem in MC, not in FLAC decoder. Would MC do the same for FLAC stored images as it does for MP3 stored images then everything would be ok, I think.

However, I have solved this by adding the following line to <head> section in all my HTML templates:

<base href="file:///C:\Documents and Settings\User\Desktop\dummy">

Again, “User” above shall be name of the actual user. Now, both MP3 and FLAC stored images are found because HTML rules say that an absolute reference is to be found exactly where it says (MP3 case) and relative reference is to be found either on “current” directory or on directory given by <base> tag (FLAC case).

Also, this doesn’t work for FLAC files generated by the old (MC 11) FLAC encoder even if you use the new (MC 12) FLAC encoder/decoder when you add image to such “old” file.

Regards/Mikael
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

Thanks for the insight as to what happens with other formats.

I have some latitude as to where I create the file and as to how I respond to MC with the filename, and I suspect that if I just create the file in the JRTemp directory and return the path in addition to the filename, then all is fixed.  I'll work on that for the next version.  In the mean time, you at least have a work-around.
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

How very interesting, it is you (FLAC decoder) who creates the file. I always thought that the decoder serves the image bits to MC and that it is MC who creates the file. Now that I know you create the file, there is another issue. When running MC on a client computer but accessing files on a server share, where do you create the image file, on server or client? This may be important when server share is read-only, as it is in my case.
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

I had been simply using the current directory, with the simple "flac_cover.jpg" file name.  Theoretically, I could put the file anywhere I pleased, as long as I return the path name to MC to find it.

The plugin functionality is that MC asks for the art via a path/filename.  I have to get it out of the flac, save it, and return said path/filename.  MC does not tell me what path/filename to use.
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206

Obviously, my Desktop is current directory when I run MC12 on my client. Please do use JRTemp as you already indicated. Many thanks for all your work and sharing it with the rest of us.

Regards/Mikael
Logged

Rudy81

  • Junior Woodchuck
  • **
  • Posts: 54

This may explain the following problem I am having.  I have MC on one drive and my flac files on another.  Cover art is a folder.jpg file in each folder.  After running MC, I find a folder.jpg on my desktop.  Can you clarify how to take care of this problem?
Logged

scthom

  • Citizen of the Universe
  • *****
  • Posts: 621

The flac plugins currently only create files named "flac_cover.jpg".  Though one of your problems referenced in the other forum is probably related, this one is not.
Logged
Pages: [1]   Go Up