2

I've accumulated hundreds of pictures and I'd like to sort them. For that purpose, more often than not, I check a list of them in Thunar, sorted by size, and then watch them with an image viewer.

The problem is that any image viewer I know (most notable eog and nomacs), when provide pagination of images, uses sort by name as the default order. Thus, the order seen in Thunar and the order seen in the image viewer are not the same.

Is there any image viewer that allows pagination by a specific sort? I know sorting in Thunar is unique to Thunar itself.

  • 2
    gwenview should allow sorting by a few criteria like date, size, name... – rudib Sep 28 '19 at 12:19
  • Pix offers the functionality – guillermo chamorro Sep 28 '19 at 17:19
  • @rudib seems like I already tried Gwenview but missed that it had this feature. Works like a charm, thanks! – Zoltán Schmidt Oct 29 '19 at 22:45
3

Using sxiv:

If your file names don’t contain newlines, it’s easy. This works because sxiv - accepts stdin:

ls -Sd -- *.png | sxiv -

This GNU variant uses a NUL terminated list and allows you to use the power of find. If you want recursion, remove -maxdepth 1:

find . -maxdepth 1 -name '*.png' -printf '%s\t%f\0' |
sort -znr | cut -z -f'2-' | xargs -r0 sxiv

Using feh:

feh -S size --reverse ./*.png

feh also allows mtime, format and more. See its man page.


All of the above solutions open an image viewer with the largest image first. Replace *.png with anything you want.

1

With the zsh shell and any image viewer that will display the images in the order they are given on the command line, you can use the oL glob qualifier to sort a glob expansion by size:

feh ./*.jpg(oL) # from smallest to largest
feh ./*.jpg(OL) # from largest to smallest
feh ./*.jpg(^oL) # from largest to smallest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.