← go back

old mp3 players and song cover art

A few weeks ago I found my old Sony Walkman mp3 player buried deep into old stuff from past. It's a blue NWZ-E something and it still looked great and after charging it up again, turned on. After I was done exploring the interfaces and drowning in nostalgia, I put some mp3 files on there but the cover art just wouldn't show :(

about 10 forum threads from 201X later...

Apparently, some time in the 2010s, we switched to a new kind of JPEG files, so-called progressive JPEGs (whatever progressive in regards to an image file is supposed to mean), "NO MORE BASELINE JPEGS" because more efficient algorithm, I guess? I didn't actually look it up :/

Objective: Convert the embedded cover art to baseline JPEGs, preferably in the shell, because I'm not gonna click the same 5 buttons in a GUI for 30+ minutes.

several StackExchange threads later...

As always there seem to be a billion ways to do this, half of them didn't work for me or my googling was bad. Some program called "eyeD3" (it's python, I think) finally worked for me and from there on it was just putting it into a for loop and not noticing that I mistyped the directory name two times, oh well.

Anyways, here's the code (gist) for the fish shell:

mkdir ./img
for i in (ls -1 *.mp3)
  # export covert art from mp3
  eyeD3 --write-images=img "$i"
  # remove all embedded cover art
  eyeD3 --remove-all-images "$i"
  # convert to baseline and re-import
  convert img/FRONT_COVER.jpg -interlace none img/cov.jpg
  eyeD3 --add-image "img/cov.jpg:FRONT_COVER" "$i";
  rm img/*
rm -r ./img

Now I have cover art on my 2011 mp3 player, cool :)