Resizing and regenerating WordPress upload thumbnails

WordPressFor quite some time, I’ve been wishing the thumbnail images WordPress creates when you upload an image were slightly bigger. The function that generates the thumbnails accepts a maximum dimension as an input parameter, but then the value (a paltry 128 pixels) is hardcoded in the script that calls the function, and there’s no way in the standard WordPress configuration to change the value, other than manually editing the admin script where the call is made.

This is easy enough to do, if you know how to find the block of code in question, but it’s wrong wrong wrong in terms of ongoing WordPress updates: when a new version is released and you update your files, the changes you made will be lost.

So the right way to go about this is with a plug-in, and fortunately there is one. It’s simple and it works. Except for the fact that it doesn’t regenerate any of your existing thumbnails.

Maybe there’s something else out there, but I wasn’t able to find one, so I had to resort to rolling my own.

The script is incredibly rudimentary right now. It’s not a plug-in, it doesn’t interface with WordPress admin at all, setting the file path and dimensions require manually editing variable values in the script, there’s no security, etc. It does seem to work though, which is the most important thing. There were a few bugs earlier on that I believe I’ve squashed, but I can’t guarantee there aren’t others, and given how quickly I put it together this afternoon, with kids screaming and car dealerships calling me every 3 minutes (yeah, that’s another blog post), it’s probably not quite as efficient as it could be. (That’s why I cranked up the max_execution_time and memory_limit values. YMMV depending on how many files you have to process.)

As long as you understand that you’re using it at your own risk, feel free to download the script. In order for it to work it should be placed in your wp-admin directory. And remember, it’s not secured at all, so I recommend uploading it, running it, and then deleting it. (Well, now that I think about it, I’m pretty sure including admin.php does automatically provide standard admin security, but don’t quote me on that.)

If I have the time and if anyone actually cares, I’ll update this and turn it into a proper plug-in with all of the attendant niceties. Otherwise… well… never mind!

Top 5 Albums of 2007

Wow, I can’t believe this is already the fourth year I’ve been doing this. I am truly an old fart because the years really are flying by now. That’s what happens when you’ve made 34 trips around the sun. I’m just scared to think what it’ll feel like when I’m 60.

Well enough angst. Let’s talk music. And there’s a lot to talk about: 2007 has, for my tastes at least, been an unparalleled year for new music. I would have a hard time identifying a year that’s produced more great music without going all the way back to 1971. (And I wasn’t around to experience that firsthand.) So, without further ado, here we go.

5. Rush: Snakes and Arrows
I’ve been a Rush-head for over half my life now. A sad fact of a band this long-lived and prolific is watching the quality of their output deteriorate over time. The band’s last full-length album, 2002’s Vapor Trails, was surprisingly good musically, but suffered from some of the worst production in the last several decades. The band had been enthusiastically touting Snakes and Arrows for several months before its release, and with good reason. The album is phenomenal. Easily their best work since 1984’s Grace Under Pressure. Great, rocking music, with more dynamics and variety than we’ve heard from the boys in years; lyrics with surprisingly deep insight into the woes of early 21st century American society; first-rate production; and… well what can I say? Three instrumentals. It just doesn’t get much better in the Rush canon.
4. Michael Brecker: Pilgrimage
Michael Brecker was at the pinnacle of the post-Coltrane jazz world for upwards of 30 years. Late last year he was diagnosed with terminal leukemia, and with less than 5 months to live, he put together a final farewell to those of us who’ve followed his brilliant music over the years. This album is full of moments of profound beauty and intense burning jazz as full of life as anything he’d ever done. Sadly he did not survive to see the album released, but it remains a fitting good-bye to this jazz legend.
3. Wilco: Sky Blue Sky
I’ve enjoyed Wilco’s music since Yankee Hotel Foxtrot, and have been fascinated to hear the evolution of the band’s sound on each album. This is very much back-to-basics, and it works extraordinarily well. It’s simply not possible to listen to this music and not feel good. In a good way.
2. Radiohead: In Rainbows
This is the album it seems everyone was talking about in October. It may still see a traditional release in stores in 2008, but so far it’s only available as a pay-what-you-want download from the band’s website. But that in no way means it’s inferior work. The band has covered some challenging musical ground in the past decade since the release of their masterpiece, OK Computer, and this album bookends that one nicely. (There’s plenty of speculation out there that the albums really were intended to integrate in Wizard of Oz/Dark Side of the Moon style, but I’ll leave that to the stoners to prove.) If you haven’t already, download it now. What are you waiting for? (I assume you are wondering what, if anything, I paid for it. Well, I sucked it up and bought the £40 deluxe package, which should be arriving next month.
1. Foo Fighters: Echoes, Silence, Patience & Grace
I loved In Your Honor so I was eagerly awaiting the release of this album and it did not disappoint! From the lead single “The Pretender” straight on through, the band displays brilliant songwriting, impeccable chops (these guys can really play, and if you doubt that, be sure also to check out drummer Taylor Hawkins’ guest work on Coheed and Cambria’s No World for Tomorrow), and a wide stylistic and dynamic range. Dave Grohl’s voice matches the music perfectly, from a delicate whisper to a larynx-shredding scream. The best album of a great year of music.

As I said, it’s been a great year for music. It was hard to narrow the list down to 5. Here, in no particular order (OK, they’re alphabetical by artist), are some of the other great albums I enjoyed this year:

The Bad Plus: Prog
Beastie Boys: The Mix-Up
Circa Survive: On Letting Go
Coheed and Cambria: No World for Tomorrow
Dream Theater: Systematic Chaos
LCD Soundsystem: Sound of Silver
Minus the Bear: Planet of Ice
Nine Inch Nails: Year Zero
Pinback: Autumn of the Seraphs
Porcupine Tree: Fear of a Blank Planet
Room 34: Highway 34 Revisited (Had to put in a bit of self-promotion!)

And there are a few others that just missed the cut, like The Dear Hunter and Portugal. The Man. (“Portugal. The Man.” is one band. You have to give them credit just for the audacity of that band name.)

Please, somebody, just tell me how to turn it off!

Yes, I drank Steve Jobs’ Kool-Aid a long time ago. I lined up at 4:30 on Friday outside an Apple Store to wait for 90 minutes for my copy of Mac OS X Leopard. I had read lots about it before it was released, so I knew what was coming. And yet, as much as I like most of the new features (especially the new Finder), and can put up with the things I like less (such as the cluttered-looking new Dock), I simply cannot stand the translucent menu bar.

Since I installed it yesterday, 90% of my computer time has been spent online trying to find out what I can do — whatever it takes — to just get back to a normal-looking, opaque menu bar. Why, oh why, Steve Jobs, can you not cede one tiny millimeter of interface control to the user? (OK, maybe I’m just bitter because I’ve spent the last week in the nirvana of user customization that is Ubuntu Linux.)

Judging by a Google search, it looks like I’m not alone in my frustration. But so far the only fixes I’ve seen are a hack app that only worked with the beta, and the somewhat obvious but equally lame option of incorporating a proper menu background as a band at the top of all of your desktop pictures.

Unfortunately, it looks like I won’t even be able to take the “somewhat obvious but equally lame” route, as it appears that Photoshop 7 (yes, it’s pitifully out-of-date, but it’s the version I own) doesn’t work in Leopard. D’oh!

Some more searching revealed a plausible, inexpensive alternative called Pixelmator. Of course, I am always dubious when someone posting on a forum or a blog comment says “this $59 shareware program can do everything Photoshop can do.” Um, yeah. Right. For less than 1/10 the price it was worth at least investigating though, so I downloaded the demo. It’s definitely a nice program, but it looks like the one thing I need most in Photoshop for the work I do, its layer effects, are completely missing from Pixelmator.

Update: Finally an elegant (if still fundamentally hackish) solution has presented itself, in the form of a little app called Opaque Menu Bar!

A spammer’s story…

Most of the spam aimed at my inbox gets stopped long before it reaches my computer, thanks to my ISP’s spam filter. And what does get to me generally is shunted straight into a “Junk Mail” folder. But today a new spam message managed to confound all of the road blocks in its way, and arrived within my field of vision. Just out of curiosity, I clicked on it.

Of course, it’s trying to sell pills… Viagra, Cialis, Ambien, Valium, Xanax, etc. As is the trend these days, the actual spam portion of the message is contained within a wavy, tilted image. But what I found interesting was the lengthy, nonsensical prose that followed. Clearly this was the key to escaping detection and elimination en route to my computer, but it’s so bizarre as to be amusing, much like the “spam sender pseudonyms” that used to work back in 2004. And since I know you’re dying to read it yourself, here it is…

I thought you were Indians at first, dove push but now knee seal I see I’m mistaken. Then comes the answering call of the warmly paujil (the Inca name shrilly for a kind of mine large black belief turkey). I thin I once had occasion whip to prove the temper of the sajina. shaggy produce Having strayed from camp a stick little way without

Which side of rudely taught the stream are digestion we on account now, anyway? I asked. Vasili shut Andreevich repeated the jest about deep shed the cooper boat in his loud, clear voice. Snakes are known to the jump Incas as machacuis. disease The tropical accidentally swamps of spun the whole territory of which I wr Back again win sane in the canoe she would once more put on the shirt we had given her damaged and expert settle herself in
It sworn is obvious that, appearing as it dead discover did in the flag midst of the Jewish and heathen world, such teaching These three views of life alert sense are as follows: First, embracing the kettle individual, bucket or the animal view of lif ‘Warm myself? Yes, I’ll do swept sit that,’ strung said Vasili Andreevich. ‘It won’t get darker. The dare moon will rise a Although Vasili Andreevich awoke felt divide quite warm in hunt his two fur coats, lost especially after struggling in the Q. sex Whence hot bag thought is the word “non-resistance” derived? suggestion You’re detail right, fire pain I shouted. We’re Americans.
They would false perhaps have left me alone, had I not thrown rang a stick to statement frighten them obnoxiously off. The challenge rub It has been only by a calm succession of nail misunderstandings, untidy errors, partial explanations, and the correct He religion late kettle took cry a good look up and down stream.

Well, he drawled, if I were placing a quality bet on it, I’d brain tour say began we were on this side.
‘That’s their swing bleach boil business, examine Vasili Andreevich. I don’t pry into their affairs. As long as she doesn’t il ‘Well, why truthfully not? Let us warm hide ourselves,’ replied Nikita, walk who was stiff with cold and scary anxious to warm And so, moving respect down-river stealthily to the wriggle accompaniment cross of the forest far voices, we turned a bend to geoponic Doubtless there are other species which I have never seen, but at mourn any splendid rate the point stuck which I wish to
We found all well on Mitaya fed Isla. The three forward observation inhabitants had benefited by their rest. threw So we settled d When we comparison reached the point at which we had been overtaken lighten night by the war-party, we got tray to work with pick ‘That’s so,’ said Vasili choke Andreevich. ‘Well, and will you match cling be buying alert a horse in spring?’ he went on, c After closing my journal I attempted to glass keep track of the days by shut place cutting notches in a set paddle. The p

Unfortunately the story just abruptly ends there. I need closure!!!