The mysteries of Google Photos and what my videos are teaching its AI

For the past few years I’ve been shooting video, sometimes very long video, on my iPhone, and then transferring it to my Mac for editing.

I have two ways to get the videos to my Mac. I can use AirDrop for a direct device-to-device transfer. But the videos also automatically upload to iCloud in the background, so I can then open the Photos app on my Mac and find them there, and download them from “the cloud.”

Neither way is exceptionally fast, especially with large files, simply because they are large files, but they both have always worked seamlessly, and I can pretty much do them on-demand as soon as the videos are done recording.

Last night I recorded a performance of the big band I play in, using… gasp! …an Android phone. Specifically, a Google Pixel 3a. Yeah, it’s pretty old. But also new to me. I need an Android phone for testing my web development work, but since I don’t use it as my day-to-day phone, I didn’t want to spend a lot. I know the Pixel is a good phone, with a clean Android install, and the price was right ($150). Which is exactly why it’s the phone I chose to shoot the video with, because I was going to have to leave it unattended all night in a crowded auditorium, about 100 feet away from me. It was unlikely to be taken, but I didn’t want to risk it with my main iPhone or even a backup. (Plus, the Pixel actually does shoot pretty good video.)

Anyway… once I got home, I then had to contend with the problem I knew would be waiting for me. This is an Android phone, so there’s no iCloud. But I am also pretty heavily invested in the Google ecosystem, so I figured I’d have no issues transferring the videos to my Google Drive — or at least Google Photos — and get them that way.

There are issues.

First, I can’t find a way to just put them on my Google Drive, which is where I really wanted them. Yes, I can just jump over to photos.google.com instead of drive.google.com, without even having to log back in, but I operate frequently in Google Drive and I had never, before owning this phone, had any reason to even consider the existence of Google Photos. But, whatever.

Second, and I could be wrong about this, it seems like the files only transfer from the device to the cloud when you have the Photos app open on the phone. I have the phone running on my home wifi, which is connected to gigabit fiber, so the transfer should be about as fast as can be expected anywhere in the United States, but even though I left the app open for an extended period last night, it only uploaded one of the two videos. I gave up waiting on it and went to bed, and uploaded the second one this morning.

But here’s the real kicker: neither of the videos is “ready” yet in Google Photos, not even the one I uploaded last night. Maybe it hadn’t quite finished uploading then but still… what exactly is Google doing to get the videos “ready”? Why aren’t they “ready” the instant they’re uploaded?

I get that videos uploaded to YouTube need to go through some processing. YouTube does all kinds of crazy crap to videos. Some of it is transcoding and optimizing the files for streaming, which… yes. 100%. Please do that. Some of it is machine learning (a.k.a. “AI”) driven, analyzing the content to make smart chapters and such, as well as detecting content that is illegal or violates terms of use. I see the benefits. And some of it is for the benefit of corporate overlords, both at Alphabet and elsewhere, such as detecting copyrighted music. Well… honestly there are pros and cons to that. But it’s not the point of this post.

The point is, I get why that kind of processing is happening to YouTube videos. But none of it should be happening to private videos uploaded to your Google Photos account. I suppose I should give Google the benefit of the doubt and assume that it’s strictly doing the AI scans for illegal content. (I think you know the illegal content I am talking about so I am not going to spell it out.)

Apple’s recent efforts to implement technology to do on-device detection of that type of content recently got a lot of heat for its privacy implications — even though on-device scanning is far more private than in-the-cloud scanning. But Apple always takes the heat for things because it’s Apple, despite Google, Amazon and Facebook engaging in much more egregious versions of those things.

The thing about Google in particular is, they’re all about amassing TOTAL WORLD KNOWLEDGE. Not in an inherently nefarious way (although maybe there’s no way for that not to be inherently nefarious). But there are always nefarious implications in what they’re doing. So whatever is going on as I’m waiting for my videos to be “ready,” the one thing I know for sure is that Google’s AI is learning something from them.

Update: I realized after I posted this that maybe I should… uh… google it. Yes, Apple themselves have provided instructions on how to transfer photos and video from Android to Mac. I realized that I could maybe use this USB-C to USB-C cable I have sitting right here at my desk to make a file transfer!

Don’t use JPEG for logos… and don’t think you can solve the problem by re-saving the JPEG as a PNG

Once you go JPEG, you can’t go back.

You may recall having seen this previously on my blog:

DON'T USE JPEG FOR LOGOS…...USE PNG INSTEAD

I’ve been singing the “Don’t use JPEG for logos!” refrain for so long that most of my clients (and whoever they’re dealing with to deliver logo image files to them) know logos on the web should be in PNG format (or even better, SVG), not JPEG.

But a lot of people don’t seem to understand that you can’t turn a JPEG into a PNG.

Oh, sure, you can technically do that. By which I mean, you can open a JPEG in Photoshop or a similar image editing program, and save it as a PNG. But doing that won’t fix anything.

JPEG is a “lossy” format. That means that its compression algorithm permanently loses data about the image for the sake of a smaller file size. There’s no way to get that data back. PNG is not a lossy format, which means that it compresses the image data in a way that it can faithfully recreate the original input image.

So, what do you think happens when you open a JPEG and re-save it as a PNG? That’s right… it looks exactly like the JPEG did.

Like I said at the beginning, once you go JPEG, you can’t go back. The only option is to track down the original source image in a lossless format, or to manually clean up the results as best as you can.

I wish I could say I’ve never done this, but I’m a pragmatic individual, and I also like to try to solve problems myself… it’s often faster and easier than tracking down the original source. More times than I can remember, I have used the flood tool to turn splotchy logos back into blocks of solid color — doing my best to clean up the anti-aliased edges. And when the characteristics of the logo are right, I’ll often re-set the text in the original fonts (recognizing fonts by sight is a valuable skill), tweaking Bezier curves if the logo has any customizations, and then try my best to faithfully recreate object shapes by tracing them with the pen tool.

It’s perversely kind of fun, and I especially like when I can do it without even bothering to tell the client. They usually just care about the results, not about how the sausage gets made. Except when the client is an Italian restaurant. Then I let them worry about the sausage.

Moments

You don’t see it coming until it’s here. The day you realize that you’re not going to be arranging any more funerals. You’re the one who’s next. It may not — you hope and believe — be for years. Decades! But it’s coming. And it’s coming for you.

You see the fading memories of the ones who went before you differently in that light. When you realize you’re the only person left who remembers the things you experienced together. And when you’re gone, that’s it. Those events never happened. At least, not to anyone who is still alive to care about them.

And what did your time amount to, anyway? What impact have you left on the world, and is it a good one? Bad? Or, most likely, utterly inconsequential. You never existed.

Maybe it’s melodramatic. But that doesn’t mean it’s not true. So if all that matters is the moment, while you’re in it… how are you going to live it?

WooCommerce code snippet: add customer IP address to admin Orders page

First off, this is not solving a problem. It’s making it easier to deal with the fallout of the problem.

Here’s the problem: bad actors steal credit card numbers, and sell batches of those credit card numbers to other bad actors who like to find ways to test out the credit card numbers to see if any are still active.

One way they like to do this is to find WooCommerce sites that sell cheap products — especially stickers, which are generally priced at $5 or less — and they use a script to spam the site with fake orders… well, real orders… for these cheap items, using fake contact information and the stolen credit card numbers. Most of them are already canceled and the transactions fail, but a small percentage of the cards are often still active, and the ability to place an order with them confirms it. I suspect the reason they place very small orders is that it’s easier for those transactions to go unnoticed by the real card owners.

Anyway, this is a problem I am seeing with increasing frequency on my clients’ WooCommerce sites, and there are generally two ways I address the problem.

First, I install Brian Henry’s WooCommerce Checkout Rate Limiter plugin. This can be very effective at throttling the scripts that place these huge blasts of orders from the same IP address, which leads to…

Second, I get the fake orders’ IP addresses and block them in the server’s firewall. You can get the customer IP address of any order in WooCommerce by clicking through to the detail page for an order. There are various ways to block IP addresses, including WordPress plugins, but I like to go straight to the source and block them in the ufw firewall right at the Linux OS level.

But the bad actors are perhaps becoming aware of these techniques to block them, and are modifying their tactics. I can see three ways they would do this, although I am only personally able to observe two of them: 1) slowing the rate of submissions, 2) spreading the submissions across multiple different sites, and 3) using different IP addresses. The first and third are the ones I can observe, of course, unless by chance the multiple sites are all maintained by me. (I do support a very large number of client sites, but not enough that this has happened yet.)

Anyway, we are now getting to the point of this post. I wanted a way to quickly see the customer IP address for a whole list of orders, instead of having to click through to each individual order’s detail page. Sure, I could fire up phpMyAdmin and do direct SQL queries, but I prefer the convenience of having this happen right within the WordPress admin. And so, I present to you a code snippet that will add an IP Address column to the WooCommerce admin Orders page:

add_filter('manage_edit-shop_order_columns', function($columns) {
    $columns['ip_address'] = 'IP Address';
    return $columns;
});

add_action('manage_shop_order_posts_custom_column', function($column, $post_id) {
    if ($column == 'ip_address') {
        $order = wc_get_order($post_id);
        echo $order->get_customer_ip_address();
    }
}, 10, 2);

That can go into your theme or a small plugin. The first block of code adds the IP Address column to the table on the Orders page, and the second block outputs the customer’s IP address in that cell in each row of the table.

Of course, this won’t stop bad actors from being bad actors. But it might help you reduce the number of fake orders your clients have to refund.

Sometimes I wonder if anyone at Apple actually uses their products in the real world, episode #532,464: the iPhone QR Code Scanner app

QR codes are a convenient way to open a URL with your phone without having to type a long string of text (especially since it’s hard to avoid typos in a URL on a phone touchscreen).

But.

The iPhone’s QR Code Scanner app in the Control Center has a really annoying feature: It doesn’t open URLs in the Safari app; it opens them in its own embedded browser.

I’m not really sure why Apple chose to do this, or why they don’t realize what an issue it can create for users. What is that issue?

If you leave the app, when you go back to it, you’re back to the camera view for scanning a new QR code, rather than whatever web page you were interacting with.

There is no “history” in Code Scanner. No “back” button on the camera screen.

Sometimes this can be trivial. Sometimes not. Here’s a scenario I just went through that turned out not to be an issue, but it very well could have been.

It was time to renew the vehicle registration on my car with Minnesota Driver and Vehicle Services. (Yes, in most states we’re talking about the DMV, but since Minnesota always has to be different, here it’s DVS.) DVS is getting into the 21st century, and they’ve started emailing out the renewal notices instead of sending paper copies. And, the email included a QR code for me to jump-start the renewal process. Cool!

So, I scanned the code (off my Mac screen) with my iPhone, and started the process. (Maybe it’s possible for the Mac to read QR codes out of an on-screen PDF… I should investigate that.)

At the end of the process, since I was paying with my debit card, I got a pop-up alert from my bank’s app about the transaction. I would have ignored that, but I got two alerts from the bank. Worried I had double-submitted, I jumped over to the bank app. No, it was fine; the second charge was just the 2.15% credit card processing fee the DVS website had warned me about.

But now… oh no! I had been completing all of the process in the Code Scanner app, so the little “back” link at the top left of my iPhone screen took me back there, which of course forgot about that complex series of web form screens I had just stepped through, and blithely displayed the camera again for me to scan a new code. Damn! Was the process complete? Probably. I hope so. I opened up my email and saw a confirmation from DVS, so presumably everything was finished. But I won’t know for sure until I get my tabs in the mail. Ugh.

Now see, here’s the thing I keep forgetting in the moment. When you scan a QR code with Code Scanner, and that QR code is a web URL, Code Scanner opens the page in its own embedded browser. But there’s a little button at the bottom right to open the page in Safari.

If you have the foresight (or memory) to tap on that little Safari compass icon as soon as you’ve scanned a QR code, all will be well with the world. But if you’re just focused on whatever you’re trying to do with the web page you’ve just opened, it’s really easy to ignore the subtle interface differences between the two apps.

I shouldn’t have to play “Can you spot the differences?” like this is a kids’ placemat at a family restaurant in the 1980s. I shouldn’t have to remember to tap the Safari icon if I’m about to embark on a seven-part journey through the minds of the lowest-bid contractors who won the job to develop a government website.

Apple needs to understand how its products are used in the real world.