Catastrophic error trying to use com4j to add cover art from file to iTunes IITrack object

Using Com4j with iTunes is not a problem adding various text values ​​to an IITrack object, but if I try to add artwork using

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); } } 

he fails with

05/11/2017 18.24.56: BST: com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges: updateITunesLibTrackFromSong: SEVERE: unable to update ItunesTrack C: \ Users \ Paul \ Desktop \ TestMusic \ WAV \ Music \ Choir Trinity College \ Carol \ 27 - In Dulchi 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) on com.sun.proxy. $ Proxy57.addArtworkFromFile (Unknown Source) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateITunesLibTrackFromSong (WindowsUpdateItunesWithChanges.java:611) on com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.addEditedTrack (WindowsUpdateItunesWithChanges.java:646) on com.jthink .songkong.ituneshelper.WindowsUpdateItunesWithChanges.analyseFiles (WindowsUpdateItunesWithChanges.java:277) on com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateItunes (WindowsUpdateItunesWithChanges.java:180) on com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call (UpdateItunesWithChanges.java : 182) on com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call (UpdateItunesWithChanges.java:32) in java.util.concurrent.FutureTask.run (Unknown source) in java.util.concurrent.ThreadPoolExecutor.unun source) in java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown source) in java.lang.Thread.run (Unknown source) Reason: com4j.ComException: 8000ffff Crash: Crash:. \ Invoke.cpp: 517 at com4j.Native.invoke (native method) at com4j.StandardComMethod.invoke (StandardComMethod.java:35) at com4j.Wrapper $ InvocationThunk.call (Wrapper.javahaps56) at com4j.Task.invoke (Task.java:50 ) at com4j.ComThread.run0 (ComThread.java:172) at com4j.ComThread.run (ComThread.java:153)

COM4j interfaces were built from my version of iTunes, so they exist, I don’t know if I am doing something wrong or if it is broken, I already tried several jpogs with the same result. I check if the files exist, and indeed, the error is different if I try to add a nonexistent file.

+5
source share

All Articles