ImageSorter

So you have written that new, must have program. Let us see it here.
Post Reply
PartierSP
Posts: 57
Joined: Tuesday 30th November 2021 12:14am
Location: Canada
Contact:

ImageSorter

Post by PartierSP »

One of my hobbies is photography. Over the years I've taken tens of thousands of photos. Most of them I had stored on my web server until a few years back when I took it off line after a motherboard failure. I recently restored the database and got the photo gallery working again. But now I had a few thousand photos to sort through and upload onto the gallery. And since my gallery is organized by events (aka Christmas 2020, Toronto 2019, etc), and I'm combining multiple cameras worth of photos, I'd have a lot to go through. So I wrote this program in stead.

This program will sort through all your JPG images and then create a copy (or if you wish a symbolic link) of the images and stored in a directory hierarchy based on the EXIF creation date. Thus if you took a photo on Christmas day last year and set the destination to be in your Pictures directory, it would place the photo in ~/Pictures/2020/12/25. The program can also cascade through a given source directory to find all photos with its sub directories.

You can find and download this project on my Github page: ImageSorter
The latest copy of the project can be downloaded by clicking on the green Code button and then clicking on Download Zip.

Image
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ImageSorter

Post by cogier »

Welcome to the forum. I agree with you when you say you liked the big User Manuals. All gone now.

I have had a look at your code. You can make life easier by reducing the line below by using &/.
From: -
Copy sDir & "/" & sFileName To DC_Out.Value & "/" & sYear & "/" & sMonth & "/" & sDay & "/" & sFileName
To: -
Copy sDir &/ sFileName To DC_Out.Value &/ sYear &/ sMonth &/ sDay &/ sFileName
You are using Quit to close the Form. This is not recommended, see here.

As I have just commented in another post, the 'dark art' of expanding forms takes a bit of getting to grips with but have a look at your program with a fully resizeable form, attached.
ImageSorter-master-0.1.tar.gz
(62.25 KiB) Downloaded 180 times
PartierSP
Posts: 57
Joined: Tuesday 30th November 2021 12:14am
Location: Canada
Contact:

Re: ImageSorter

Post by PartierSP »

Thanks for the input! I have also read through the 'Did You Know' thread and have since discovered I've been using == instead of = on a lot of my if statements. Here I go mixing languages again. :roll:

That &/ is a cool tip. Thanks. When I uploaded the code I quickly scanned through it and I don't see why I didn't use a variable so I only have to construct that mess once and simply call the new variable. I forecast a revision in the near future.

I am an absolute noob when it comes to resizing forms. Back in my old VB days I used to have to move and resize everything manually within the program. I don't recall VB6 (the last VB I ever used) having any of the containers that would assist in this matter. I briefly looked at containers like this when I was looking at GLADE. But was having trouble with getting any code to work that I never got far with it at all. So for the time being I limited myself to writing staticly sized forms. I have since downloaded your EXIF program and had a quick peek and saw all the container use (BTW very nice program! :D ). It provides very good example of how they can be used.
Post Reply