Posts Tagged ‘cover art’
I updated my Cover Art Resizer program.
- configurable output verbosity
- allows wildcards in directory names
- “force” switch for thumb.jpg re-creation
The program takes one or more paths as an argument, searches the entire directory tree for “cover.jpg” files and creates “thumb.jpg” files in 100×100 pixels size. It also embeds the thumb.jpg into the mp3s found in the directory.
It requires the Python Image Library and Mutagen. (If you have setuptools installed, the dependencies will be installed automatically)
You can install by running
python setup.py install from the source code distribution or installing the supplied EGG or using the EXE.
coverresizer -h for help. (Your Python Scripts directory must be in the PATH)
I just wrote a small python script that allows you to create thumbnails on all your cover.jpg album art in your MP3 collection.
Make sure you save the covers as cover.jpg in the folder that contains the MP3s. This is recognized by most programs.
With this script you can generate thumbnails for all the cover.jpg files:
#!/usr/bin/env python import sys from os import path, walk from PIL import Image, ImageOps def process_path(dir): for dirpath, dirnames, filenames in walk(dir): for name in filenames: if name == "cover.jpg": if not path.exists(path.join(dirpath, "thumb.jpg")): process_image(dirpath, name) for name in dirnames: full_path = path.join(dirpath, name) process_path(full_path) def process_image(dirpath, name): full_path = path.join(dirpath, name) print full_path img = Image.open(full_path) img = img.resize((100,100), Image.BILINEAR) img.save(path.join(dirpath, "thumb.jpg")) if __name__ == "__main__": dir = sys.argv print dir process_path(dir)
You’ll need the Python Imaging Library. Just call the script with the root path of your MP3 collection as the first command line parameter.
You might want to import the thumbnails into the MP3s with software like MP3Tag.