Project, Python, Research

Automating Making Memes & Instagram Posts 8: Populating My Cat Nikon Pics Folder

In order to populate my cat photos for my Instagram account The Cat Geek, I need to transfer my photos from my Nikon camera’s SD card to my external harddrive that is mounted to my raspberry pi server.

Smoosh is blocking the view of the raspberry pi, but I swear it’s there!

Ideally, I want to be able to transfer my Nikon photos from my Linux laptop so I don’t have to use my desktop at home. This would give me flexibility to take pictures anywhere in the world and not rely on being at home to put them into my Instagram photo folder.

First I needed to read the pictures from the SD card, but since it is formatted as exFAT, my Ubuntu operating system could not read it. I ran through the following commands from the article How to Mount and Use an exFAT Drive on Ubuntu Linux [Quick Tip].

sudo add-apt-repository universe
sudo apt update
sudo apt install exfat-fuse exfat-utils

After the exfat-fuse and exfat-utils successfully installed, I attempted to download the pictures into the Shotwell software that Ubuntu suggested.


Unfortunately, my laptop ended up freezing, and I had no idea what to do since I had never encountered this with a non-Windows OS before. After googling on my phone, I found a forum post with several suggestions of what to do if Ubunutu freezes.

Because the mouse and keyboard were both unresponsive, I ended up using this incredible “magic trick”. I held alt+sys req (I had to use the function key as well on my laptop) and then typed “REISUB”. Suddenly, the laptop rebooted and everything was back to normal.

Omfg I need to commit this to memory: Reboot; Even; If; System; Utterly; Broken.

Now that I can mount the SD card, I noticed that the NEF files thumbnails do not show a preview. To fix this for Ubuntu 18.04 specifically, I needed to run one simple command in the terminal.

sudo apt install libopenraw7 libopenrawgnome7 gnome-raw-thumbnailer
BOOM! Easy as that

So now that I was able access my photos and view their previews, I needed a good program to edit them and move them to the correct folder for my Instagram bot to access. After looking through the Top 10 Linux Photoshop Alternative Photo Management Software I decided to install digiKam for photo management, and GIMP – High-Quality Photo Manipulation for photo editing.

sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt-get update
sudo apt-get install gimp
sudo apt-get install digikam

I might look into Pixelitor – Raster Graphics Editor later since it has layer functionality. And if I ever need to batch process my NEF files into JPEG, it looks like RAWTHERAPEE would be a good option.

After launching digiKam I got the error “digikam failed to create tables in database”. I tried uninstalling and reinstalling, but still receive the same error, and have had no luck finding a solution. Eventually I discovered these instructions, and was able to go back through the initial configuration of digikam again.

Pictured: me, everytime I run into some annoying error

This time, I stored the database files on my desktop PC’s SSD, since the error was from an inability to store them on the external harddrive where my pictures are located. Next, I needed to be able to convert my pictures into JPGs so they can be used on Instagram. The easiest way to batch convert I found was by installing the UFRaw tool on my raspberry pi that is physically connected to the harddrive containing the pictures.

sudo apt-get install ufraw
cd /media/pi/Nikon\ Pics/etc
ufraw-batch --out-type=jpeg --out-path=./ ./*.NEF

The batch convert ran without any issue, and the resulting pictures worked flawlessly with Instagram. Rejoice!

Now that I’ve got my photo software working I just need to play around with it and figure out how it works. But I’ll save that for next time.

For now, I’ll populate some content for my bots to use for the next few weeks while I work on testing and improving their scripts. Then when the programming is solid, I can just focus on the fun stuff like taking pictures and learning how to edit them! Until then, here’s some cat pics to enjoy! 🙂

Leave a Reply