Remember digital picture frames?
I found an old digital picture frame at a tag sale and couldn't figure out what I wanted to do with it.
It shouldn't come as a surprise, but I do frequent yard sales, thrift stores, and anywhere else I think I can find old computer and tech stuff to play with. A year ago I found a digital picture frame for three dollars that I thought I could do something with, so I bought it, took it home, and stuck it in a corner for six months and forgot about it.
Eventually, I remembered that I had the thing and did some research. It's a ViewSonic VFD820-50. It has an 8'' screen, has a resolution of 800x600, it supports images up to 4000x4000 pixels (which it scales down), it can take an SD card up to 32GB, and it supports JPEGs and only JPEGs. I can work with this.
Fortunately, 32GB SD cards are still relatively cheap and widely available. But I still needed something to put on it. I could do stuff like my friends, my family, my pets, etc, but I wanted something else.
Too many years ago on another website, I spilled a lot of digital ink documenting video game tips, tricks, and cheats, which required screen shots. And for every screen shot I used, I had a handful that I didn't use and just never deleted for some reason. Fortunately, I kept all of the screenshots in one place. Unfortunately, some of the snapshots had names that contained things like ! and [!] and & which meant that I could move them around with stuff like ls, but anything more complicated than that would choke with weird errors (spoiler, we're going to be doing more complicated stuff in just a couple of sentences!), so I took some time using tools like dired to load up the list of files and let it do the heavy lifting of renaming files to take care of my haphazard file naming1.
Once I had the names squared away, I wanted to convert them to jpg and I wanted to convert them to as close to the display resolution of the frame as possible. I did this for three reasons:
- The frame will convert them before displaying them, but I'm sitting here with a much more powerful computer, and it makes more sense in my brain to convert them all once instead of having the frame do it every time it displays something
- Smaller pictures take up less room on the SD card
- Smaller pictures also take less time to load from the SD card, so it feels like the frame performs better2
To convert all of the pictures to JPGs and make sure they're all about the right size, I copied them to a temporary directory /wrk/frame/ made a directory to hold the converted pictures and ran something like this: find ./ -name "*.png" | xargs -I {} magick {} -resize 800x600 resized/{}.jpg
It looks complicated, but what this does is finds all the .png files in the current directory, passes the name of each one to ImageMagick to resize it appropriately, and then put it in the 'resized' directory with its same name, but with .jpg at the end. This converts it to a jpg, but it also means that the resulting files all have two file extensions, i.e. image.png.jpg. These are going onto an SD card where I'll never look at the names again, so that doesn't bother me. If it bothers you, then feel free to name them anything you want.
This was a good start, but I wanted more.
I have a Nintendo Switch, and it has a dedicated screenshot button. I use it to take screenshots a lot. Something cool happened, take a screenshot. Something weird happened, take a screenshot. My finger slipped when I changed my grip, take a screenshot. And double-bonus: the Switch saves them to an SD card and the're already jpgs. Perfect!
I grabbed a cheap MicroSD to USB thumb drive adapter, plugged the SD card in and mounted it to /mnt/sdcard using something like mount -t msdos /dev/da1p1 /mnt/sdcard 3, and it was… less than perfect.
The Switch does store its screen shots in jpg format, it's true, but it likes to put them into an annoyingly complex directory structure. It stores them in a directory by year, then a subdirectory for the month, then a subdirectory for the day, then each filename has a datestamp and a unique identifier per game. It's impossible to tell what game a screenshot is just by looking at it in a terminal window without either looking up the ID in a database or opening the file in an image viewer.
I used basically the same find and copy command above to just dump all the jpegs into one directory so I could give them a quick look to delete anything that had any personal info on it, or anything that I didn't want on there (I have a lot of screenshots of the Switch lock screen, for example5). Then I ran the same magick command above to shrink the images down to something reasonable.
When it was all said and done, I put just over 3,000 video game screenshots onto this digital frame, and have only used about 241MB out of 32GB. I have lots more room and the next project is finding out some way to fill it.
Footnotes:
I didn't do anything too crazy, I just did a search and replace for the problematic characters and replaced them with nothing. There were over a thousand square brackets alone, so my wrists are glad that I didn't do this by hand
This could all be in my head
I'm running FreeBSD. If you're following along at home from something else, you'll have to figure out the correct incantation on your own, but this should get you started4
Yes, I know that the Switch supports MTP. No, I didn't use it
It turns out that when it says to 'press any button 3 times to unlock it, the 'capture screen' button doesn't count