 Okay, this is a follow up to yesterday's video, or one I put up a day or two ago, where we fixed thumbnails, but something I forgot to mention, and didn't realize at the time of recording it, is that when you do update the thumbnails on an image, it updates the time stamp on the last time that image was modified. What you probably don't want with images, you know, it still will have the time and date stamp of when it was taken in the information of the image, but a regular file manager or your shell is not going to see that, it's going to see last time the file was modified. So if you have like a whole month or a whole year, a whole bunch of photos in a folder, and you run them, they're all going to have the same date, and you can't sort them by date anymore. So we're going to fix that, and don't worry if you did already do that, it's the information is still in the metadata for the image so we can get that. But real quick, let's look at another example. Last video I talked about rotating, and all just has to do with when the thumbnails are generated. So yesterday I was rotating the images, and they weren't getting thumbnails that all totally generated them. They were going to do it in a way that actually creates the thumbnails, let me make this a little bigger, creates the thumbnails, but doesn't necessarily create them at the right time. Let me show you what I mean. I'm going to convert one of these images to black and white. So I can use image magic, I can say convert, I can give it one of the file names, and then I can say dash color space, and then I can just say gray, and I'll say output dot PNG, or let's make it a JPEG, just to keep it consistent. So we do that, and you can see there's no thumbnail, if I refresh my thing over here, you can see we have these two images, the output one, and you can see it's in color in the thumbnail here, but if I click on it, it's a black and white image. Apparently it's generating the thumbnail before it's done converting the image over. And again, you might be concerned, you know, oh, that's a, that's not that long a command, but that's a long command. Again, as I talked about in previous videos, the point of using the shell is that you can make aliases in scripts. So I actually have a script I created, it's just like two lines of code, or maybe a few more, it goes through a loop so I can go through all the images, but I can just say black and white, and I can give it an image name. And when I do that, it's going to automatically create a new file with the same file name underscore BW for black and white. You can see there, and then I can also do this, I can say black, white, and give it an asterisk and we'll convert them all. Now, if I refresh over here, some of them actually created black and white thumbnails and some didn't. Again, I think it's just, it's generating the image and the thumbnail, and just depending on when the thumbnail is generated, you may get the proper thumbnail, you may not in this case. But we're going to fix that. And again, in the previous video, we ran this command. We're using the XIF trend for updating the meta information, dash I dash G, we hit that, and it updates them all. So they all have the proper thumbnails, they're all black and white, they're black and white color, if they're rotated, they're rotated the right way. But again, if I list out all my files here, you'll see they all have the same date and time because they were all generated now. So if I had a whole bunch of images and I wanted to sort them by date, for example, over here, if I go here and I say modify, they all have the same modifying date, which is not good. Again, in the photo editing software or photo viewing software, it will look at the date stamp of when the photo was taken. So we can fix that because that information is still in the photos, even in the brand new generated black and white ones, it still has those meta tags of when the image was created. Now, I'm going to show you a command here, this. Again, we're using the XIF tools, but we're doing all this and what it's doing is it's going to take the original timestamp of when that file was created. And then we're going to use XRX to touch that image so it updates it with that date. Now, again, big long command, I'll have notes in the description of this video, I can run this, and it will run through them all. And now if I list them all, you can see that they have the proper date stamps of January 2, January 8, and the timestamps. And if I bring this back up, I can modify sort it by modification date, and they are all listed. You can see the black and white ones, even though they were newly generated, they still had that timestamp of when the original image was taken. So let's do this. I'm going to go ahead and just to recap, I'll delete all those and I'll regenerate them. So again, I'm going to say black, white, asterisk, and it's going to regenerate all those. And you can see some of them are in color, some of them are black and white. Now, again, we have two commands here, we have this command that updates the thumbnail, and then this command that fixes the timestamp. I put them both in a script. And now I can just say fix thumbnails. And again, there'll be a link to this script, which again, it's just two lines, it's just running those two commands. But I can just run this one command here and it's going to go through all the files in this directory, fix thumbnails and fix the timestamps. And again, if we do this, we can now sort by modification date, and they all have the proper modification date of January 1 or January 8, depending on when they were taken. Same when I list over here. So that's just a little follow up again. Don't be afraid of big long commands like this one here. It's not as scary as it looks, you don't even need to remember it because you can alias it or put it in a script again. I'm not going to go over the details of each one of these, but basically, you know, it's getting the year, month, date, hour, minutes and seconds. And then it's getting the original timestamp for all the files in the directory, and then it's running through each one of them and the touch command just updates the command, but we're updating it with the time that we're passing that we grabbed had the metadata. That's the basic concept of it. You don't need to remember all that. Look in the description of this video. There'll be a link to both this script and my simple little black and white script. And you can get them, and that's it. So just wanted to follow up on that in case you were experiencing that because it is annoying when you go into your photos directory and try to sort by date, and they all have the same date and time. That's not helpful. So yeah, luckily, when you modify photos in most cases, unless you tell it to remove the metadata, the metadata is there. So GPS coordinates and time and date stamps and camera and lens used and whether you're using your phone, all that sort of stuff is usually embedded in these images, which you can strip. But luckily, it's still there even if you update the file. So thanks for watching. Please visit films by chris.com. That's Chris of the K. There'll be a link in the description as well as a link to both these simple little scripts so you can look at them. And I hope that you have a great day.