Category Archives: Product Review

Resizing Images for a Digital Photo Frame

My wife recently returned to work after a year of maternity leave. I figured that she might miss being home with me and our son, so I bought her a digital photo frame for our anniversary. To seal the deal, I dug back through all of our digital photos and selected a few hundred that I felt best represent the different stages of our relationship.

The frame that I chose is pretty bare bones. After some shopping, I settled on the Aluratek ASDMPF09. It’s a 10″ frame with 4GB of internal memory and a 1024×600 pixel display.

Probably don’t buy one of these. The only redeeming thing about it is that it is incapable of connecting to the internet. God knows what a shit show that would be…

There’s not much to this device, but while researching, I found that the market leaders in this sector have gone full Internet of Shit in their offerings – Every device comes with a web service, cloud storage, and an email address. Some even require an internet connection to operate. And so I chose to stick with the low tech model in hopes of a better, more secure product, albeit with fewer bells and whistles.

What I didn’t bank on was this device’s absolute inability to rotate and resize images at display time. Here’s an example of what I mean:

The image on the left is the original. On the right, you can see the image as displayed on the digital picture frame. The colour, contrast, and pixelation is the result of taking a photo of the digital frame’s display. These artifacts aren’t present in person, but the horizontal squishing is, and it looks god awful, particularly on pictures of people.

At first, I thought that the problem was the height of the image. I figured that the frame was removing horizontal lines from the image to resize it to fit on the 600px tall screen. Perhaps in doing so, it decided to remove the same number of vertical lines from the image, causing it to look unnaturally squished in the horizontal direction. That would be stupid, but also understandable.

I tried to solve for this by resizing the source image such that it had a maximum width of 1024px and a maximum height of 600px, all while respecting the aspect ratio of the original image. In practice, this meant that the resulting image was either 800x600px or 600x800px, depending on its orientation.

Unfortunately, this did not solve the problem.

After a bit of digging, I remembered that older iPhone cameras used to save time when taking photos by writing files to storage in whatever orientation the phone happened to be in when the photo was taken. To compensate, they added an EXIF attribute to the file to indicate that the photo needed to be rotated at display time. Most devices, including Windows, implicitly handle this reorientation and you never notice that it’s happening. The digital photo frame that I purchased tries and fails, leaving the image stretched in nasty ways that make it look unnatural.

We can see this EXIF re-orientation magic happening in practice by running one of the affected photos through Phil Harvey’s excellent ExifTool. It spits out all of the metadata associated with the photo, including this attribute that instructs the display device to flip the image upside down:

Orientation: Rotate 180

To solve the problem, I can rotate the image such that the EXIF attribute is no longer necessary, and then remove that metadata so that the digital frame does not try to modify the image on the fly at display time. I actually wrote up a solution to this problem way back in 2016 when WordPress did not properly handle the issue. If you read that post back in the day, the rest of this one is going to look eerily familiar.

Then as now, the solution is to sprinkle a little bit of ImageMagick over my photos, resizing them to the dimensions of the digital photo frame while retaining their aspect ratio, re-orienting them as necessary, and stripping any unnecessary EXIF metadata along the way. The end result is an image that the device does not have to resize or rotate at display time.

With a little bit of help from StackOverflow and the folks on the ImageMagick forums, I figured out how to do all of this in a single command:

magick.exe convert -auto-orient -strip -geometry 1024x600 input.jpg output.jpg

This operation is pretty straightforward. Let’s break it down into pieces:

  • convert: tells ImageMagick that we want to modify the input image in some way, making a copy in the process
  • -auto-orient: rotates the image according to the EXIF Orientation attribute if present, effectively undoing the iPhone’s laziness
  • -strip: Removes any unnecessary EXIF data, including the Orientation attribute that is no longer required to correctly display the image
  • -geometry widthxheight: allows us to specify the desired width and height of the output image, in this case 1024×600. By default, this option preserves the input image’s aspect ratio
  • input.jpg: is the path to the file that we want to resize
  • output.jpg: is the path to write the resized image to. Note that this operation will not modify input.jpg

One thing that you’ll notice is that this command only resizes a single photo. Since I have an entire directory full of photos that I need to process, it would be ideal to batch them out. Unfortunately, ImageMagick’s convert utility can only operate on single files. No matter, though – I’m on Windows, so I can wrap the operation in a Powershell command that enumerates all of the files in the current directory and pipes each filename into the ImageMagick convert command for processing:

Get-ChildItem -File | Foreach {magick.exe convert -auto-orient -strip -geometry 1024x600 $_ resized\$_}

You need to run this operation from within the directory that contains all of the images that you want to process, since the Get-ChildItem -File command lists every file in the current directory. We pipe that list into the Foreach command, which loops over every file in the list, substituting its name in for every instance of $_ in the {} braces that follow.

The result is a resized and correctly oriented copy of every image, each with its original filename, all in a directory called resized that resides within original directory of images. One nice side-effect of this operation is that the 300 or so photos that I wanted to put on the frame shrunk in size from 1.7GB to around 80MB. That’s means that I can put significantly more photos on the device than expected, which is a bonus.

Leave a Comment

Filed under Product Review, Software

Building the Lego James Bond Aston Martin DB5

For a few years now, I’ve been in the habit of buying myself a Lego set to build over the Christmas holidays. Most years, I pick up a Technic set, but this year, I decided to purchase the Lego James Bond Aston Martin DB5 set, item #10262.

I recently finished building the model, and was very impressed with it. This is the first traditional Lego set that I’ve built in quite some time, so I have surprisingly little experience with models like this, given that I have a large Lego collection.

I was particularly interested in the building techniques that the designers used to model all of the curves and angles on this vehicle. Throughout the build, I was thinking about how designing a set like this must be a constant negotiation between the scale of different parts. Not only does the scale of the finished vehicle have to make sense relative to the diameter of the tires, but the curves on the hood need to be appropriate relative to the overall size of the model, and there are a limited number of Lego pieces to choose from when making those decisions.

As an infrequent builder of traditional Lego sets, I was also really impressed with the construction of the set. Even elements like the vehicle’s doors that you would think are straightforward to build are actually constructed from dozens of small pieces arranged in a really clever manner to achieve the shape that’s required.

The angles that make up the dashboard, windscreen, and trunk of the vehicle are all established by connecting clips and handles together at an angle that isn’t typical to Lego. This means that many of the bricks that make up these parts are at strange angles to the body of the car, instead of everything being built parallel to the ground.

Building techniques aside, I really enjoyed building this set as a James Bond fan. A couple of years ago, my wife and I watched every Bond film in chronological order, and the Aston Martin DB5 is a vehicle that features heavily in canon. True to the films, this model has a number of sneaky spy car features, including a working ejector seat.

Leave a Comment

Filed under Lego, Product Review

How to Install Brass Threaded Inserts

I’m currently working on building a crib for my firstborn son. There are two elements of this design that make it unique among the furniture that I’ve created in the past:

  1. The mattress should have two distinct heights: an upper height for when he is an infant, and a lower height for when he is a toddler
  2. I need to be able to disassemble the piece; both to move it into the nursery, and for storage once my son has outgrown it

I opted to solve both of these problems by building the crib out of five flat pieces that are affixed to one another using 3/8” brass screws and threaded inserts. I chose brass here for its aesthetics, thinking that the brightness of the brass would play nicely against the warmth of the wood.

The product that I chose for this purpose was E-Z Lok 3/8”-16 threaded brass inserts:

The kit comes with some the threaded inserts, and appropriately sized drill bit, and a slot head driver that is supposed to allow you to drive the threaded inserts home using a drill. Separately, I purchased some slot head brass screws that thread into these inserts from McMaster Carr.

When choosing these fasteners, I made the mistake of assuming that both the screws and threaded inserts needed to be made out of brass brass.

In practice, the threaded inserts are never visible when the crib is assembled, so I could easily have used a threaded insert that was made out of steel, which would have handily avoided all of the problems that I encountered when trying to drive the relatively soft brass inserts into the hard oak of the crib body.

On the right, a virgin threaded insert. To the left, a threaded insert that was destroyed when I tried to drive it into the end grain of a piece of oak using the tool included in the kit

After a few of the brass inserts tore themselves to pieces during my early testing (which I thankfully conducted on scrap, and not on my finished piece), I turned to Reddit to ask the community of r/woodworking for help installing these fasteners.

The solution came from user u/okacookie who suggested that I thread a nut most of the way onto a 3/8”-16 hex head bolt, and then thread the bolt into the threaded insert, jamming the threaded insert up against the nut. This way, a hex driver or ratchet can be used to drive the threaded insert into the oak workpiece without having to rely on the flimsy slot head that has a tendency to rip to if you so much as look at it the wrong way. Once the threaded insert has been driven home, the bolt can be backed out, leaving the insert behind.

In practice, I found that starting the threaded insert with the slot driver that was included in the E-Z Lok kit before switching out to the jam nut and ratchet combination worked best for me.

In closing, if you find yourself using these brass threaded inserts, first ask yourself if they absolutely have to be made from brass. If not, use a stronger metal. If so, ditch the silly slot head driver and use a bolt with a jam nut to get the job done.

1 Comment

Filed under Product Review, Wood Working

CNC Router Review: Sienci Labs Mill One v2

In this video, I build and test Sienci Labs’ Mill One V2 desktop CNC machine. Along the way, I give my impressions of the build quality and assembly process. Once complete, I walk you through a few test cuts and review the machine.

This is my first experience with a CNC router, so I don’t have much to compare it to. As such, my review is relative to other common wood shop tools, and not to other CNC routers that you may have used.

Leave a Comment

Filed under Product Review