Archive for the 'web tech' Category

When you couldn’t be bothered, until…

I’m no huge fan of AI. I feel like more often than not it’s contributing to brain rot, cognitive outsourcing, the same way GPS destroyed spatial awareness and mental mapping to the point nobody can follow simple instructions like: “Turn left at the first traffic light, then second right, and it’s the 5th house on the left next to the only big tree on that street”.

With AI I’m seeing people rewriting every single, absolutely benign email to a client or supplier, every comment, outsourcing every simple task. Simple to the point they wouldn’t even have to take a minute to look up how it’s done. They know how it’s done, just don’t feel like doing it on their own.

The “intelligence” certainly has its place. Need to write some bullshit user manual for a 3 button user interface (ON/OFF, source 1, source 2) that no sane person would ask for? Bureaucrats aren’t known for their sanity, so you ask the AI to expand one sentence into 3 pages and you’re done. Need a 50-page report nobody will ever read, they just want to tick a box? By all means drown that insanity in a mountain of bullshit sentences and figures to match the stupidity of the request.

But then there are tasks that are complex. That would require a significant amount of time and effort studying the problem, learning about possible solutions and their implementations, and eventually troubleshooting your mistakes. As was the case with something that happened to this blog many years ago, and I never really bothered, because I knew how that would go, and it just wasn’t worth it.

Long story short, at some point, well over 10 years ago, codepage in the database that runs behind this blog, got a bit scrambled in one of the moves between servers. Non-typical characters like ã, è, ë, Þ, ñ etc. turned into an unreadable mess known otherwise as mojibake (文字化け).

Ardèche turned into Ardèche, Pinhão became Pinhão, Þjórsá an unrecognizable ÞjórsÃ

I’ve been mulling it over every now and then, but haven’t found a simple solution that wouldn’t take a disproportionate amount of my time. It just didn’t bother me enough. Last time I looked at it was in 2019, still no simple way out. Then came this weekend, in bed with fever with nothing to do and a quiet house, the problem popped into my mind again. But this time there was hope. In the past year AI actually became useful for stuff beyond producing nonsense. I’ve used it for a number of tasks that would take a long time to solve “manually”. I’ve used it for stuff I’d never even attempt on my own because I’m just not that comfortable with code, or illustration, or music. It’s becoming good enough.

So I gave it a crack. And a few prompts later I had a fix, a way to test its functionality, and a way to deploy it directly on the blog. I’ll say this last step had me a bit on edge. I’ve learned not to test on production a while ago. But at the same time I didn’t feel like spending even more time deploying a test environment just to verify what looked ok at a glance. Afterall, it’s just an old personal site with not much going on.

Apparently it worked.

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.

Older posts »

Gallery