Tech Tips, Web Development/Programming

How to Fix Image Resizing Problem in the Arthemia WordPress Theme

I downloaded the Free Arthemia WordPress theme the other day to use with my students’ FBLA site. I really like how the theme looks like a professional newspaper like the New York Times as wells as how easy it is to add Headline and Featured stories just by assigning a category to them.

One thing I could get working was the images that show up with the Headline and Featured stories when you add the Image custom field to an article. The images would just show up as a red x. When I tried to view them in Firefox, I got the following error:

finfo_open(): Failed to load magic database at ‘/usr/share/misc/magic’.

After poking around on the Internet for a minute, I found that there are some files that PECL finfo uses to sniff out the MIME type of files. Apparently, the files are some sort of flat file database that holds, well, MIME types.  Luckily, I extrapolated a solution after seeing a workaround on a forum. If you’re using Arthemia Free Version 2 and are having the same problem getting your images to load, here’s all you must do.

Replace lines 216-220 of the /wp-content/themes/arthemia/scripts/timthumb.php with the following code:

$file_cmd = "file -ib  \"$file\"";
exec ($file_cmd, $exec_output);
$mime_type =  $exec_output[0];

That’s it! The only other thing you have to make sure to do to get your images to resize and show up properly is to put the absolute path to the images without your domain. So, in my case, I have an image whose full path is:

http://breathittfbla.com/wp-content/uploads/2009/07/foreman.jpg

To make it work, the value for the Image custom field has to be set to:

/wp-content/uploads/2009/07/foreman.jpg

After changing those lines of code and then putting the right file path in the Custom Field, Arthemia is resizing and displaying images in Headlines and Featured Stories without issue.  I hope this helps somebody!

Personal Updates

For Whatever Reason, I Now Eat Lots of White Rice

Anybody that’s known me for awhile knows I’m not a fan of vegetables, other than potatoes. But for whatever reason, I have been addicted to eating white rice for the last few weeks. Beck and I went to Peking’s in Hazard and I had sweet and sour chicken (which was great). It came with a side order of steamed white rice. I ate some…I really enjoyed it. Since then, I have eaten two boxes of instance rice. Beck says rice looks like maggots, and I’m inclined to agree. Dad always said my taste buds would change as I got older, but who knew it would be toward the end of the spectrum where rice lives.

Political Commentary

I Guess the CIA Should Start Putting Out a Newsletter

Dick Cheney is under fire for not disclosing a secret plan to kill Al’Queida leaders at close range to Congress. At what point does Congress need to know military secrets? These are the same people that can’t even conceal their kinky affairs or charges that they have sexually harassed staff. I think we should make our elected officials feel good about themselves by filling them in on extraneous details. Military matters that need to be kept secret, however, are beyond these people. I wish matters were different, but with the way things stand right now, the more we keep these people in the dark, the less they’re going to screw things up.

Tech Tips, Web Development/Programming

WordPress Meta junkies: Use Headspace2

I haven’t been a WordPress user very long, but I have found one plugin that eased a big issue with me: Good meta descriptions in WordPress posts, categories, and archives. Out of the box, WordPress isn’t really equipped o use Excerpts as the Meta Description for a post. Enter Headspace2, which allows WP authors to edit Meta Descriptions to their heart’s content.

Personal Updates

Good Bye, Custom Blog…Hello WordPress

I’ve been debating on whether or not to switch to WordPress for about a year now.  Part of the reason I held off is because I like to write my own software. My custom-written PHP blog setup was tweaked over a period of 6 years. It served as a proof-of-concept for a lot of things I learned how to do in PHP. For being the active testbed, I thank my old blog.

That being said, I just couldn’t resist WordPress any longer.  A lot of really smart coders that I admire use WordPress to manage their blogs and sites. If it is good enough for the best, then it is good enough for me.  I think this will really help me get more ideas out there. I have always enjoyed posting fixes and whatnot that I figure out, but my custom blog was nowhere near this slick. And, I must say, migrating my old blog to WordPress is the most fun coding that I have had in a long time.

OS X, Tech Tips, Web Development/Programming

Solution to Deployment issue using Netbeans 6.5.1 and Tomcat 6.0.22 on OX 10.5.7

Somehow I always find myself in the middle of a very strange computer problem. This particular issue is a result of my wanting to learn to write JSP applications using Netbeans 6.5.1 with Tomcat 6.0.20. I don’t have time to do a full writeup, so here’s a nutshell version of the problem and my solution:

Problem

When I tried to use the Deploy option to push my Netbeans project to my Tomcat webapps folder, the deployment would fail. I could manually copy the .war file into my Tomcat webapps folder and everything would work fine. But, I thought, “Why should I have to do this if Netbeans is supposed to do it for me?”

Solution

Since I’m running OS X 10.5.7, I opened the Netbeans configuration file at

/Applications/NetBeans/NetBeans6.5.1.app/
Contents/Resources/NetBeans/etc/Netbeans.conf

and added the following to the netbeans_default_options line:

-J-Djava.io.tmpdir=/tmp

Note: This must be added within the double quotes. Also, I didn’t distrub anything that was on the line already but merely added that tidbit of code.

Explaination

I found this piece of advice buried deep in a forum. Apparently, Netbeans puts the deployed files into a temporary folder before deploying them. The temporary folder it tries to use on OS X isn’t accessible (a permissions problem I guess). Adding that snippet of code tells Netbeans to use the OS X default temporary folder tmp for its intermediate work.

Enjoy!

Microsoft Windows, Tech Tips

What to do if Cygwin Does Not Work Properly in Vista

So, I tried to install Cygwin on my Windows Vista Business machine today.  The install, via the setup.exe that downloads what you want to install, launched and completed as it always had in WIndows XP. I was pleasantly surprised considering how Vista has refused to install things normally before. Just when I was about to be happy, I clicked on the Cygwin Bash Shell shortcut, the prompt came up, but no commands worked.  Not ls, not dir, not anything! I let out my usual sigh of annoyance and cursed Vista (for the millonth time).

I then proceeded to Google to find a solution.  Nothing. The forum posts pleading for help were responded to with the usual worthless suggestions (such as “Don’t use Vista“) and RTFM talk. I don’t really want to use Vista, but it has been forced upon me and I have little recourse but to use it.  Anyway, after trying a few things that didn’t work, I finally figured out what to do: Set your system path environment to the Cygwin bin directory and everything works fine!

To do that, all you gotta do is follow these simple steps:

  1. Install Cygwin normally with the setup.exe program, selecting what you want to install.  For the purposes of this walkthrough, I’m going to assume you installed Cygwin in the default C:\cygwin location.
  2. Click on the Start Menu (or Windows Orb, for those of you Vista fanboys).
  3. Right Click on Computer, and choose Properties.
  4. Click Advanced system settings in the left-hand context sidebar (and accept the UAC prompt to go proceed as an Administrator).
  5. Click the Advanced tab
  6. Click the Environmental Variables button at the bottom of the dialog.
  7. In the Environment Variables list box, find the variable Path and double click on it
  8. In the resulting Variable Value box, move your cursor to the end of the line of paths already there and add ;C:\cygwin\bin Do not forget the semicolon before the path!

That’s it! Remember, if you installed Cygwin somewhere other that C:\Cygwin, you’ll have to change your path to be different from my example. I’m hoping that if you did a non-standard install that you can figure out how to adjust the path!  I hope this helps somebody!

Microsoft Windows, Tech Tips

Using MS Server 2003 Admin Tools with Vista

Today I tried running the Windows Server 2003 Admin tools with Vista Business and was a little surprised when I got the error message:

MMC could not create the snap-in.

I guess the only reason I was shocked was that I got no errors whatsoever. The install went just fine. Normally, when you attempt to install an older Microsoft tool that isn’t compatible, Vista will freak out and let you proceed no further.

After a some Googling (and several leads that did not work), I found a fix on the Microsoft Knowledge Base: http://support.microsoft.com/kb/930056

The fix was actually quite easy: Finding the fix was another story!

Personal Updates

To WP or Not to WP…

So, I have installed WordPress 2.7 on my long-forgotten TravisSmith.us domain. I have been considering migrating JerryTravis.com to WordPress, so for now, this is a testbed to see if I really like the platform enough to do so.

Scroll to Top