Check Image Dimensions Without getimagesize()

In a forthcoming project, it was necessary to check the dimensions of a remote image before deciding to cache it or not. While the PHP native function getimagesize() exists, it has some pitfalls. The biggest being: it relies on allow_url_fopen being enabled. While allow_url_fopen is not inherently dangerous, many web hosts do not have it set to prevent issues caused by inexperienced users (including Weblogs.us). Additionally, getimagesize() will retrieve the entire image—a waste of bandwidth, and time. This guide will cover finding the dimensions of images in the PNG and GIF formats with a word on JPEG and why it makes life difficult.

Download Sources

Continue reading

Absence and Upcoming Events

There is a fresh guide in queue, ready for review and then release. It’s related to image dimensions and PHP. Originally, it was to be released yesterday, however it depends on some elements that need styling. It will be out some time this week.

Almost two years have come and passed since I originally created Cran-Berry, and it has grown stale. There are two potential replacements, both have been mocked up. One is more of a grunge theme (similar to the Cran-Berry 2 Mockup 1).  The other is more of a natural progression from the current Cran-Berry. The biggest changes to note are a slight narrowing of the over all page size, a change in the navigation setup, wider article space, taller footer, and some tweaks to make the site more navigable in mobile browsers (on the Motorola Droid). Currently, the plan is to update on April 23rd, the 5 year anniversary of this blog on Weblogs.us.

There is also a new plugin in the works. It is already written, and in initial user testing. Unlike WP Trainer, which has barely seen the light of day, this plugin will be released as public beta in April.

Breadcrumb NavXT will receive an update in either April or May. At the moment, I need people to test out the SVN trunk. It contains a vastly rewritten settings page (doesn’t look different, but the code behind it is). Currently, the bcn_breadcrumb_trail class is more or less the same as in 3.4.1. So there is some work still left to do. Finally, if you are using the WP SVN trunk, you’ll need to use the Breadcrumb NavXT SVN trunk, it contains some minor fixes to reflect changes in the WP API in 3.0.

-John Havlik

[end of transmission, stay tuned]

A New Year

With the changing of years, months, and the forthcoming changing of seasons a change in design and accompanying style is immanent. Originally, these changes were to take affect last summer. Yet, somehow they were delayed, as have other projects. This comes from a desire to separate more professional content and personal content (well, it would allow the posting of more personal content as of late little has been posted). While being the self proclaimed “Enemy of the Spammers”, one has not made proper use of this tagline. So there are two options, earn the title, or relinquish it. One’s choice will be apparent in the coming weeks.

Now to talk about a neglected project. WP Trainer, still hasn’t seen the light of day, even though its code base size is equivalent to that of Breadcrumb NavXT. Lack of direction is really the reason for the delay. There is almost too much to do with it, after a concise scope is defined work will resume. The other hold up is that some portions rely on things that are possible in WordPress but are quite hackish to implement (many of these problems went away in WP 2.8, and more went away in 2.9). Currently, WP 3.0 is the target platform. Finally, some work being done at the moment on Breadcrumb NavXT will benefit this project.

Breadcrumb NavXT will probably have 3 feature adding releases in 2010 (3.5, 3.6, and 3.7). The current version in development, 3.5, will add support for custom post types and will contain many “under the hood” improvements which will be detailed at a later date. The release time frame for this around mid to late Q1. Version 3.6 will add extended support for WPMU/WP 3.0, essentially covering the one thing that makes WPMU a different animal. This release will correspond to the WP 3.0 release (probably in late H1).

-John Havlik

[end of transmission, stay tuned]

Breadcrumb NavXT 3.4.1

This is the first bug fix release for the 3.4 branch of Breadcrumb NavXT. Those with PHP short tags disabled should no longer get the unexpected $end on line 1567 in breadcrumb_navxt_admin.php error. Using the paged option will no longer cause a WP_Error to string conversion error. Finally, flat taxonomies leading up to a post will become linked again. Hopefully this covers all of the bugs in Breadcrumb NavXT 3.4.0, if you are still experiencing problems with 3.4.1, leave a comment below in the comments section.

You can grab the latest version of Breadcrumb NavXT from the Breadcrumb NavXT page.

-John Havlik

[end of transmission, stay tuned]

An Unexpect End Error

Ok, so a few of you have reported a PHP error involving an unexpected $end in breadcrumb_navxt_admin.php on line 1567. After some searching and thinking, the cause was found. Line 1248 of breadcrumb_navxt_admin.php has an improper opening tag (<? instead of <?php). For some reason only Windows based PHP installations were catching this. None-the-less, this has been fixed in the SVN trunk and a bug fix release, 3.4.1, will be made next week.

As one has not been able to reproduce this error on either of one’s testbeds, feedback from those who had this error is essential to ensuring that it is fixed. If you experience the error with Breadcrumb NavXT 3.4.0, please try the SVN trunk and see if it is resolved and report back in the comments section of this post.

-John Havlik

[end of transmission, stay tuned]