Wordpress doesn’t create thumbnails

Imagemagick-logoI had an interesting issue hit my site recently, that I still can’t figure out WHY it happened, but after a few days of troubleshooting, I have figured out what happened, and how to fix it.

First, let me say that my site runs on a Mac Mini running Mavericks (10.9.5). So, all of this MAY come down to some update Apple released recently, I’m really unsure. I also run my site behind Cloudflare, which I also was curious about. It seems to have cropped up on/around the time Wordpress 4.2 was released, which is what I thought the issue was at first (and why I was involved in the wordpress.org forum thread here). The issue is basically that Wordpress, in my case, wouldn’t generate thumbnails for JPG image uploads, but PNGs would. The issue cropped up right around the time that wordpress 4.2 was released, so the natual causation logic seemed to point to Wordpress being the issue. Interestingly, it wasn’t. After banging my head on this for a while, a coworker finally found a note that Wordpress defaults to using ImageMagick (imagick.so) for image processing if it’s present, otherwise it uses GD. So, I found a “plugin” that forces Wordpress to use GD, and that fixed it. So crap, the issue is my ImageMagick install. The problem is, Wordpress is failing silently, and not throwing ANY errors.

So, I added a simple script to test imagick using some code I found on php.net hoping it would actually throw an error. And it did throw an error:

PHP Fatal error:  Uncaught exception 'ImagickException' with message 'Wrong JPEG library version: library is 70, caller expects 90

There we go. So, the issue is ImageMagick is being compiled against libjpeg version 9, but when it’s going to run, it’s being handed version 7. So, I was able to do an “mdfind” and see I had version 9 and 8 installed, as well as 7, both in /usr/local/lib, and with my PHP install. So, knowing I installed both 8 and 9, I removed 8 and 9, so only 7 was avaible, and then recompiled ImageMagick, and uninstall and reinstall imagick.so. Then, I ran my test, and it worked!

Nikon SB-400 Repair

SB-400-Speedlight-Unit_frontI recently found, and purchased, a broken Nikon SB-400 Speedlight off eBay for $35. Knowing I’d been looking for one for years, I figured worst case the tube was bad, and I’d be able to replace that for less than $15. The seller was great to work with, and got the unit shipped out immediately. The unit arrived, and I had a small hope it just worked, since the seller indicated they didn’t have a camera to actually test it with (and interestingly, the SB-400 has no “test” button (you can’t press the ready light and get it to fire like pretty much every other camera flash that has ever existed)). But, sadly, it didn’t work. Okay then, time to take her apart (WARNING: Camera flashes contain a high voltage (and relatively high capacity) capacitor. In most cases, these can hurt you. It SOME cases, they could probably kill you. If you don’t know how to properly discharge these capacitors, DO NOT attempt flash repairs yourself!).

The unit has (I know this in hind sight) 3 screws that hold it together. Two are obvious on the bottom side by the flash head itself, and one is in the battery compartment, under a small stick on plastic “cover”. After these three are removed, the flash opens relatively easily, and you are greeted by the top board (which houses the micro controller) the capacitor, and the flash head. In my case, I discharged the capacitor using a multimeter with a “Lo-Z” adapter on it (Fluke calls theses a Stray Voltage Adapter, but basically, it’s a MOV in a box that makes the multimeter have about a 3k ohm input impedance, so discharging the capacitor and watching it discharge is easy).

[Read more…]


fdrhighresBeing a data nut, a relatively recent electronics enthusiast, and now a burgeoning “time nut”, there was a thread on the timenuts email list on monitoring the mains frequency (60Hz in North America, and 50Hz most other places), and how accurate it actually is. One of the responses pointed toward FNET, or a project run by the University of Tennessee. They provide a “box” that you plug into your network, mains (120V in my case), and a GPS antenna. It measures your mains frequency with what I assume is a zero cross detector, correlates that frequency with a highly accurate 1PPS signal that it’s GPS receiver generates, and then streams that data to the FNET servers (which can be viewed here).

Thinking that sounded pretty awesome, I contacted them, and asked if they wanted a box in Eugene (my intent being to install it on Campus in my office). They jumped at the chance, and sent me a box. A week or two later, I got it, and tried to set it up. Sadly, after a couple days of futzing, I realized to my dismay that Low-E windows block GPS signals. =( BUT! I have access to the “penthouse” where they have all our HVAC equipment, and has roof access. After some investigation, and some help of a friend, I was able to run the GPS cable through an empty 1″ conduit, outside, up the side of the penthouse, and onto it’s roof, which is solid steel, so the magnetic GPS puck sticks great. The unit itself I hung from some electrical conduit using some Velcro straps. Also slapping a label on the unit saying to contact me if there are any questions (since a box with flashing lights on it, could be confusing to a random Facilities employee).

GPS lock was great (I average about 10 satellites), and the cable was a perfect length (5 meters). I would suggest they switch to SMA connections for their GPS in the future, but meh. If you’re curious, take a look here. I’m unit #1033. It’s interesting to see how the mains frequency droops, or elevates during the time of day, and knowing whether that’s when people are just getting home, or leaving, etc. I would also highly suggest reading up on the US Power grid, and how the West and East are joined by the Texas interconnect.