View Single Post
  #55  
Old August 17th 18, 01:26 PM posted to alt.comp.freeware,alt.comp.os.windows-10
Terry Pinnell[_3_]
external usenet poster
 
Posts: 732
Default Sort files by aspect ratio?

Paul wrote:

Terry Pinnell wrote:
Terry Pinnell wrote:

Anyone know of a tool or hack that will do something that Win 10 File
Explorer unfortunately cannot: sort a folder of files into aspect ratio
(width/height)?

It's an operation I need quite frequently, such as when trying to
isolate all files with say a 16:9 ratio (to some fine tolerance if
necessary).

Terry, East Grinstead, UK


Reinhard has developed a great solution based on GAWK and EXIFTOOL,
pulled together by a batch file.

It's not only marginally faster than Destinations2Folders but also shows
the originals sorted to aspect ratio, which I sometimes prefer before I
split off into subfolders. (That's the approach I used in my own macro -
which was about 150 times slower!)

In practice the source folder, typically a copy of the originals, is
selected and 'Ratio-Rename' selected from the right click context menu,
a shortcut to that batch file having already been copied to the Send To
folder.

The files are then renamed with prefixes defining the AR and sorted by
that name.

My test folder of 100 JPGs and BMPs were processed in under 4 seconds on
this PC under Win 10 Pro (i7, 4.0GHz, 32 GB).

Excellent work, thanks Reinhard!

Terry, East Grinstead, UK


Here's my test result.

My test folder had 120 files, of which my
criterion of 4:3 with a 1 percent tolerance
caused 47 files to be copied.

The timing function uses "timeit" from rktools.

https://s15.postimg.cc/6z9oq7k7v/skimmer_test.gif

I have problems with most of the timing tools I've
used over the years, in that I can't believe what
I'm seeing. I guess I'm not very good at guestimating
time with the ole Mark One Eyeball.

I modified skimmer.awk slightly, to remove some
of the print statements in the output, so the screen
wouldn't be quite such a mess. The debug statements
were left in the version I published, to make it
easier to figure out when something was going wrong.

Paul


Just under a tenth of a second? From clicking 'Go' to seeing your
finished result?

Terry, East Grinstead, UK
Ads