Editing PDF metadata

Sometimes it is necessary to check, remove or modify the metadata of PDF files. Here is a quick post to show how it can be done in the terminal on Ubuntu Checking PDF metadata Most PDF viewers have an option for showing the metadata of PDF files. This can also be done in the terminal using the “pdfinfo” command-line tool. First, we need to install the “poppler-utils” package: sudo apt install poppler-utils Once installed, you can check the metadata by using the following command:...

April 10, 2023 · 1 min · 186 words · ARJ

Optimizing JPEG files

I have previously written about how to resize all the images in a folder. That script was based on lossy compression of the files. However, there are also tools for optimizing image files losslessly. One approach is to use the .jpgoptim](https://github.com/tjko.jpgoptim) function available on ubuntu. Here is an excellent explanation of how it works. Lossless optimization As part of moving my blog to Hugo, I took the opportunity to optimize all the images in all my image folders....

December 9, 2022 · 1 min · 169 words · ARJ

Convert HEIC photos to JPEG

A quick note-to-self about how I managed to download a bunch of photos from an iPhone and convert them to.jpg on my laptop running Ubuntu 22.04. As opposed to Android phones, iPhones do not show up as a regular disk with easy access to the DCIM folder storing photos. Fortunately, Rapid Photo Downloader managed to launch the iPhone and find all the images. Unfortunately, all the files were stored as HEIC files, using the High Efficiency Image File Format....

September 18, 2022 · 1 min · 164 words · ARJ

Convert a folder of LibreOffice .ODT files to .DOCX files

I don’t spend much time in traditional “word processors”, but when I do, it is usually in LibreOffice. Then I prefer to save the files in the native .ODT format. But it happens that I need to send a bunch of files to someone that prefers .DOCX files. Instead of manually converting all the files, here is a short one-liner that does the trick using the magical pandoc, the go-to tool for converting text documents....

August 13, 2022 · 1 min · 107 words · ARJ

Add fade-in and fade-out programmatically with FFmpeg

There is always a need to add fade-in and fade-out to audio tracks. Here is a way of doing it for a bunch of video files. It may come in handy with the audio normalization script I have shown previously. That script is based on continuously normalizing the audio, which may result in some noise in the beginning and end (because there is little/no sound in those parts, hence they are normalized more)....

August 9, 2022 · 2 min · 285 words · ARJ

Export images from a PDF file

I have previously written about how to export each of the pages of a PDF file as an image. That works well for, for example, presentation slides that should go on a web page. But sometimes there is a need to export only the images within a page. This can be achieved with a small command line tool called pdfimages. One way of using it is: pdfimages -p -png file.pdf image This will export all images in file....

June 16, 2022 · 1 min · 135 words · ARJ

Adding subtitles to videos

In my ever-growing collection of FFmpeg-related blog posts, I will today show how to add subtitles to videos. These tricks are based on the need to create a captioned version of a video I made to introduce the Workshop on NIME Archiving for the 2022 edition of the International Conference on New Interfaces for Musical Expression (NIME). This is the video I discuss in this blog post: Note that YouTube supports turning on and off the subtitles (CC button)....

June 11, 2022 · 6 min · 1193 words · ARJ

Em-dash is not a hyphen

I have been doing quite a lot of manuscript editing recently and realize that many people—including academics—don’t understand the differences between the symbols hyphen, en-dash, and em-dash. So here is a quick explanation: hyphen (-): is used to join words (“music-related”). You type this character with the Minus key on the keyboard, so it is the easiest one to use. en-dash (–): is used to explain relationships between two concepts (“action–couplings”) or in number series (0–100)....

May 13, 2022 · 2 min · 327 words · ARJ

Programmatically resizing a folder of images

This is a note to self about how to programmatically resize and crop many images using ImageMagick. It all started with a folder full of photos with different pixel sizes and ratios. That is because they had been captured with various cameras and had also been manually cropped. This could be verified by running this command to print their pixel sizes: identify -format "%wx%h\n" *.JPG Fortunately, all the images had a reasonably large pixel count, so I decided to go for a 5MP pixel count (2560x1920 in 4:3 ratio)....

April 13, 2022 · 1 min · 162 words · ARJ

Soft drop shadows in LibreOffice Draw

My new book will be published Open Access, and I also aim only to use open-source tools as part of the writing process. The most challenging has been to figure out how to make nice-looking illustrations. Parts of the book are based on the Ph.D. dissertation that I wrote a long time ago. I wrote that on a MacBook and made all the illustrations in OmniGraffle. While it was quite easy to make the switch to Ubuntu in general, OmniGraffle has been one of the few programs I have really missed in the Linux world....

August 12, 2021 · 2 min · 356 words · ARJ