Archive for the 'web tech' Category

Fixing incorrectly sized thumbnails in NextGEN Gallery widget

UPDATE The bug described below is due to a currently undetermined WordPress theme conflict. It also affects default twenty series themes prior to 2013.

…again one of those posts that are more a reminder to myself, but if anyone else find these things useful…

I’ve been using NextGEN Gallery for years now and it’s had one persistent bug since the beginning. I honestly don’t know how this is still an issue in a gallery plugin for and by people who supposedly care about quality presentation of their images, photos or anything else?!

In sidebar 2 to the right I’m using a widget to display 5 most recently uploaded photos. But this widget has had the same stupid bug since I can remember and the same bug I have to fix any time I upgrade to a new version of the plugin. For some reason the widget completely ignores width/height (aspect) ratios of images, instead it stretches/squeezes them to fit what are supposed to be maximum values (option available in widget settings). I simply want them to be of a certain width to fit the sidebar but I don’t care how high they are.

My solution is simple but it still annoys me that this is even an issue in a photo gallery product. People can’t possibly be shooting/wanting squeezed images?!? Anyway, my solution has always been to modify display_gallery.php (in current version 2.0.61 located in wp-content/plugins/nextgen-gallery/products/modules/widget/templates) and simply delete the height variable (entire line 24 in current version).
height="php echo esc_attr ($settings ['image_height']);"

Obviously someone bound by height restrictions would delete the width (line 23) in this case and obviously this shouldn’t even be required for anyone who cares about correctly sized images.

Like I said, this bug has been around for years but nobody bothered to fix this ever so I’m always reluctant to update to newer versions as they always mess things up and I have to remember how I fixed it in the first place.

YouTube 4K

Just a quick note for those interested… YouTube recently introduced 4K into their lineup of supported resolutions (240, 360, 480, 720, 1080, 4K). Obviously the choices of recording in 4K are very slim so you won’t see many films in the near future but it’s coming. Slowly but surely. So YouTube wanted to be a part of it. Nothing wrong with that. Here’s a sample 4K playlist. However, on full HD 23″ LCD screen the results look horrible. I’m going to presume it’s not just the heavy compression. The 1080p option looks infinitely better. So don’t even bother opening the 4K original if you don’t have a damn good connection and a 4K projector, screen or some other way to view it in full resolution. You likely don’t. Or as Ramesh Sarukkai of YouTube puts it:

First off, video cameras that shoot in 4K arenā??t cheap, and projectors that show videos in 4K are typically the size of a small refrigerator.

fGallery & WordPress 2.9

Today I upgraded to the newest WP version 2.9 (auto upgrade) only to be greeted by a blank screen. I didn’t know what caused the error, presuming it had something to do with automatic upgrade process within WordPress, so I logged in via FTP and deleted all the files (other than wp-content folder) and uploaded them again manually. This didn’t produce any results so I went back to WordPress.org upgrade manual where it says plugins should be disabled prior to upgrading (I skipped that step at first). I then deleted my plugins folder and started uploading and activating them back one by one, quickly realizing in the process that the problem was with fGallery. I’ve been planning on moving on from this troublesome plugin for a while now but so far had no time to migrate completely.

I guess this last issue put another nail in the coffin and I’ll try to move on as soon as possible. What happened is that fGallery requires two files in the wp-includes folder that appear to be missing in WP2.9 and that triggered a fatal error while attempting to reactivate the plugin. Since my old galleries still require fGallery to display photos I needed a solution. And it was a simple one, I just copied gettext.php and streams.php from an older release of WordPress. It doesn’t seem to bother the new version and my galleries are working again so until I disable fGallery for good those two files are staying there.

Older posts »

Gallery