5

Using Com4j with iTunes, no problem adding various text values to a IITrack object but if I try and add artwork with

if(iTunesTrack.artwork().count()==0)
{
  String path = new File(new File(song.getFilename()).getParent(),"folder.jpg").getPath();
  if(Files.exists(Paths.get(path)))
  {
      iTunesTrack.addArtworkFromFile(path);
  }
}

it fails with

11/05/2017 18.24.56:BST:com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges:updateITunesLibTrackFromSong:SEVERE: Unable to update ItunesTrack C:\Users\Paul\Desktop\TestMusic\WAV\Music\Choir of Trinity College\Carols From Trinity\27 - In Dulci Jubilo (organ solo).wav:8000ffff Catastrophic failure : Catastrophic failure com4j.ComException: 8000ffff Catastrophic failure : Catastrophic failure : .\invoke.cpp:517 at com4j.Wrapper.invoke(Wrapper.java:187) at com.sun.proxy.$Proxy57.addArtworkFromFile(Unknown Source) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateITunesLibTrackFromSong(WindowsUpdateItunesWithChanges.java:611) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.addEditedTrack(WindowsUpdateItunesWithChanges.java:646) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.analyseFiles(WindowsUpdateItunesWithChanges.java:277) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateItunes(WindowsUpdateItunesWithChanges.java:180) at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java:182) at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java:32) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com4j.ComException: 8000ffff Catastrophic failure : Catastrophic failure : .\invoke.cpp:517 at com4j.Native.invoke(Native Method) at com4j.StandardComMethod.invoke(StandardComMethod.java:35) at com4j.Wrapper$InvocationThunk.call(Wrapper.java:356) at com4j.Task.invoke(Task.java:50) at com4j.ComThread.run0(ComThread.java:172) at com4j.ComThread.run(ComThread.java:153)

The COM4j interfaces were built from my version of iTunes so they exist, I don't know if I am doing anything wrong or if its broken, I ve had tried on a number of jpogs all with the same result. I check the files exist and indeed the error is different if try to add a nonexistent file.

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • Are you sure it's not a path problem? are you using an absolute path? It seems to work ok for this guy here: https://discussions.apple.com/thread/3167465?tstart=0 (C# also uses the COM iTunes library, and E_FAIL return code is "catastrophic failure"). – Simon Mourier Jun 10 '17 at 07:46
  • Well yes I think so String path = new File(new File(song.getFilename()).getParent(),"folder.jpg").getPath(); – Paul Taylor Jun 14 '17 at 08:13
  • I'm not familiar with Java so I'm not sure, but this is a standard cause of problems on the COM side. – Simon Mourier Jun 14 '17 at 08:37

0 Answers0