Can I create a view mode that sorts by Dimensions

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Jorge24
Junior Member
Junior Member
Posts: 20
Joined: 2016-11-06, 18:14 UTC
Location: USA

Can I create a view mode that sorts by Dimensions

Post by *Jorge24 »

In Options > View Mode, I can change the sort order to Name, Ext, Date, Size, and Unsorted. Is there a way to sort using other fields such as Dimension (for images) or Track Number (for music files)?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You need to switch to a custom columns view for this.
Author of Total Commander
https://www.ghisler.com
Jorge24
Junior Member
Junior Member
Posts: 20
Joined: 2016-11-06, 18:14 UTC
Location: USA

Post by *Jorge24 »

What I'm trying to do is use the Autoswitch feature to automatically switch to a view mode that sorts files by image dimension when I browse certain folders. Is there a way to set the sorting order of custom columns to "sort by dimension" by default?
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Custom columns | View Mode | Auto Switch Mode | Sorting

Post by *tuska »

2Jorge24
There is a solution - below is an example for pictures.
You will at least need one content plugin for the view.

Plugins
1.  ImgSize 2.03
1.1 fields: [=imgsize.Width], [=imgsize.Height] --> separate columns for sorting: e.g. width 5472, height 3648
2.  ShellDetails Version 1.25
2.1 field: [=shelldetails.Dimensions] --> only one column for sorting: dimensions e.g. 5472 x 3648

Download the .zip file(s) and double-click on it for installation of the plugin(s).

Creation of a "Custom columns - View" (with plugin ImgSize installed)
 1. Recommended(!): Switch to a directory in TC that already contains pictures
 2. Configuration - Options - Custom columns - New
 3. Name: e.g. Photos_dimensions
 4. Button "Add column"
 5. Caption: Path (Name and Ext. already defined as default)
 6. Click on the "+"-sign -> Plugins "imgsize" -> double-click on "Width" under Properties or OK
 7. Field contents: [=imgsize.Width]
 8. Button "Add column"
 9. Click on the "+"-sign -> Plugins "imgsize" -> double-click on "Height" under Properties or OK
10. Field contents: [=imgsize.Height]
11. tick: Adjust Tabs to window width
12. tick: Horizontal scrollbar
13. Button "Apply", OK, OK

Pull the column separation lines to the desired widths.
With "Configuration" - "Save position" you should save your settings regarding column widths now.

The "Custom columns view" can be displayed as follows (at this time manually):
 1. Right-click on a column header,...
 2. Menu "Show" - "Custom Columns Mode"
 3. After pressing a button in TC with command: cm_SrcCustomViewX Photos_dimensions (X=No. of your "Customs columns view")
    At this point, I strongly recommend to create a button with command: cm_SrcViewMode0
    (cm_SrcViewMode0 8500 Source: Default view mode (no colors or icons)

Creation of a "View Mode"
- Configuration - Options - "View Mode"
- click on Button "Add..."
- Name of your "View Mode": Photos_dimensions_W-H (example!)
- Button OK
- Columns view: Choose your "Custom columns - View"(!) by clicking the dropdown-arrow, i.e. Photos_dimensions
- Sort order: Choose "Width" or "Height" by clicking the dropdown-arrow, e.g. "Height",
  then you have the possibility to choose "Descending" by clicking the field
- check the next fields...
- Auto run commands: |cm_SrcViewMode0 --> press button "Help" for details --> you need this command when the "View Mode" is left
  to return to your "View Mode" <Default>;
- "View Mode" <Default> should be defined(!), e.g. Columns view: Full, Sort order: Name.
View modes can be toggled manually using the View menu or automatically by custom rules.

The "View Mode" can be displayed as follows (at this time manually):
- Menu "Show" - "Custom View Modes"
- After pressing a button in TC with command: cm_SrcViewModeList Photos_dimensions_W-H
  At this point, I strongly recommend to create a button with command: cm_SrcViewMode0
  (cm_SrcViewMode0 8500 Source: Default view mode (no colors or icons)

Creation of an "Auto Switch Mode"
- Configuration - Options - "Auto Switch Mode"
- tick "Automatically switch view mode on directory change"
- click on Button "Add..."
- Rule: +: Must match, Directory: e.g. I:\photos\* (only example ... see below
  --> press Help for details, e.g. * ... = The folder "I:\photos" and all subfolders
- Option: Click on "More sub-rules" and note the button "&" on the left (click on it) regarding parameters "& AND (all match)"
  and "| OR (any match)"
- Rule: Click on the dropdown-arrow to see more options like "%: At least 50% match", "?: At least one match", etc.
- As a rule for you could probably the rule with parameter "%: At least 50% match" fit,
  File types: *.ani *.bmp *.gif *.ico *.jpe *.jpeg *.jpg *.pcx *.png *.psd *.tga *.tif *.tiff *.wmf
  Also, because you can call the desired view (="View Mode") at any time via a button.
- Set this mode: ... Choose this field content by drop-down box: Photos_dimensions_W-H (= Name of your View Mode!)
- Click on button: Apply, then OK

Attention - Rules - Overlaps:
TC goes through the list of rules from top to bottom, and applies the first one that applies.
The same also applies to overlaps in the sub-rules!
- Use arrow up (Moves the vertical position one line up) or
- use arrow down (moves the vertical position one line down)
to change the order in the list of rules [=> Prioritization change!].

Example:
- Rule: "%: At least 50% match" --- File types: *.3ga *.669 *.a52 *.aac *.ac3 *.adt *.adts *.aif *.aifc *.aiff *.amr *.aob
  *.ape *.awb *.caf *.dts *.flac *.it *.kar *.m4a *.m4b *.m4p *.m5p *.mid *.mka *.mlp *.mod *.mpa *.mp1 *.mp2 *.mp3 *.mpc
  *.mpga *.mus *.oga *.ogg *.oma *.opus *.qcp *.ra *.rmi *.s3m *.sid *.spx *.thd *.tta *.voc *.vqf *.w64 *.wav *.wma *.wv *.xa *.xm
- Rule: "%: At least 50% match" --- File types: *.ani *.bmp *.gif *.ico *.jpe *.jpeg *.jpg *.pcx *.png *.psd *.tga *.tif *.tiff *.wmf

In my case, the "Auto Switch Mode" did not work immediately.
For me it was even necessary that I had to change the previous order, so that the "Auto Switch Mode" was executed.
Hopefully that was just an exception, but it cost me some time to find out.

Custom columns | View Mode | Auto Switch Mode
viewtopic.php?p=329888#329888 Overview
viewtopic.php?p=329833#329833 Button for View Mode <default>; Shortcut for a View Mode

I wish you success.

Regards
Karl
Jorge24
Junior Member
Junior Member
Posts: 20
Joined: 2016-11-06, 18:14 UTC
Location: USA

Post by *Jorge24 »

Wow I didn't realize it would take that many steps. Thank you for all the help!
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Custom columns | View Mode | Auto Switch Mode | Sorting

Post by *tuska »

Small correction to:
tuska wrote: 2018-04-06, 14:03 UTC Creation of a "View Mode"
- Auto run commands: |cm_SrcViewMode0 --> press button "Help" for details
--> you need this command when the "View Mode" is left to return to your "View Mode" <Default>
According to newer knowledge |cm_SrcViewMode0 should not(!) be used here (just leave the field empty),
because the View Mode is automatically terminated anyway due to the Auto Switch Mode rule.

See also:
Overview: View Mode | Auto Switch Mode | Custom columns view
1. VIEW MODE ... Auto-run commands ... |cm_SrcViewMode0 - 1 of 3:
Post Reply