image view, delete, step. HowTo?? [SOLVED}

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
greengeek
Posts: 1357
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 501 times
Been thanked: 185 times

image view, delete, step. HowTo?? [SOLVED}

Post by greengeek »

Does anyone know of a utility that allows the user to step through images in a directory and easily keep or delete each image based on a keyboard shortcut or single click?

Something like viewnior - but adding buttons that say:
- "delete this image and step to next image in directory"
- "keep this image and step to next image in directory"

and maybe also a button that says:
"rename this file then step to next image in directory"

I am assuming that this might be easy to code with a basic x image viewer (i seem to recall x has the ability to display images in a frame without fancy software but i could be wrong...)

I recovered hundreds of files from a failing disk drive but they all have meaningless names like f000123857 and i know that i will need to discard probably 50% of the images as damaged or worthless. If there is also a rename-on-the-fly function that would be an added bonus.

(Running Tahr32 and Slacko 5.6 at the moment)

EDIT :
SOLUTIONS :
Viewnior (use delete key)
MMview
Geeqie

More heavyweight options:
gthumb
XNviewer

Last edited by greengeek on Fri Jan 29, 2021 8:15 pm, edited 3 times in total.
williams2
Posts: 1059
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 302 times

Re: image view, delete, step. HowTo??

Post by williams2 »

geeqie works in Xenial, Bionic, Fossa, I don't know if it would work in Tahr or Slacko

User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 20 times
Been thanked: 415 times

Re: image view, delete, step. HowTo??

Post by MochiMoppel »

greengeek wrote: Thu Jan 28, 2021 10:23 pm

Does anyone know of a utility that allows the user to step through images in a directory and easily keep or delete each image based on a keyboard shortcut or single click?

MMview
Apart from deleting you could move the bad ones to a trash folder (or the good ones to a keep folder), rename, redate, tag or do whatever you fancy. Fastest way is to use shell command(s) in command box and press F4.
Don't know what you mean by "rename-on-the-fly". With a single click? If Exif metadata are still intact you could rename to the Exif date, even all files at once.

If MMview is not easy enough then try ROX-Filer. If your images are of format JPG, PNG, TIFF, GIF or BMP you can display the folder content with big thumbnails. ROX-Filer will recognize these files even if the extension is missing. Those without a thumbnail display are most likely damaged and you can delete them right away. For the rest the thumbnails may be good enough to decide if you want to keep or delete.

Last edited by MochiMoppel on Fri Jan 29, 2021 8:18 am, edited 1 time in total.
User avatar
Grey
Posts: 2016
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 375 times

Re: image view, delete, step. HowTo??

Post by Grey »

greengeek wrote: Thu Jan 28, 2021 10:23 pm

Does anyone know of a utility that allows the user to step through images in a directory and easily keep or delete each image based on a keyboard shortcut or single click?

Try compiling gthumb. One of the best image viewers in terms of size-capability ratio. There you can delete images completely or to the trash and rename them. This is done both with the keys and through the context menu.
https://github.com/GNOME/gthumb

If the size is not intimidating, then XnView.
It seems 666philb added it to PPM. This is for fossapup 64. viewtopic.php?p=3884#p3884
There are so many variations of Puppy now that we sometimes offer packages from another version. Here is a generic .deb for 32-bit versions:
https://download.xnview.com/XnViewMP-linux.deb

Last edited by Grey on Fri Jan 29, 2021 7:41 pm, edited 1 time in total.

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
bigpup
Moderator
Posts: 6836
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 874 times
Been thanked: 1472 times

Re: image view, delete, step. HowTo??

Post by bigpup »

In Viewnior

Use arrow keys to step through images.
Use delete key to delete the image being shown.
After deletion, It will go to next image.
If you do not want delete to pop up are you sure warning.
In preferences uncheck confirm image deletion.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
greengeek
Posts: 1357
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 501 times
Been thanked: 185 times

Re: image view, delete, step. HowTo??

Post by greengeek »

bigpup wrote: Fri Jan 29, 2021 1:32 pm

In Viewnior
...
Use delete key to delete the image being shown.
After deletion, It will go to next image.
If you do not want delete to pop up are you sure warning.
In preferences uncheck confirm image deletion.

Thanks Bigpup - that is a great tip. I had no idea deletion was possible in Viewnior. Just via DELETE key - Very handy!

MochiMoppel wrote: Fri Jan 29, 2021 1:20 am

MMview
Apart from deleting you could move the bad ones to a trash folder (or the good ones to a keep folder), rename, redate, tag or do whatever you fancy.

I had not thought about using mmview for this - it is an excellent option. The Ctrl+X shortcut gives me easy deletion and mmview has the advantage of telling me the actual image size in pixels too. (This was handy because the recovered files included multiple versions of different sized icons so knowing the actual size helped make a quick decision about which to delete).

Don't know what you mean by "rename-on-the-fly". With a single click? If Exif metadata are still intact you could rename to the Exif date, even all files at once.

Actually using "F2" gives me easy access to the rename function. Perfect.

The EXIF idea is an interesting one - how much exif functionality is already built into mmview?

It does tell me when exif is available but i could not see how to read it: (see edit below)

Metadata-exif.png
Metadata-exif.png (289.65 KiB) Viewed 911 times

.
EDIT : Ahhh yes - that is what the "i" button is for. Excellent.

Access-Exif.jpg
Access-Exif.jpg (60.62 KiB) Viewed 894 times

If MMview is not easy enough then try ROX-Filer. If your images are of format JPG, PNG, TIFF, GIF or BMP you can display the folder content with big thumbnails.

The limitation of the thumbnails is that it doesn't offer enough clues as to the true size of the image. mmview is perfect in that area.

Grey wrote: Fri Jan 29, 2021 6:18 am

Try compiling gthumb. One of the best image viewers in terms of size-capability ratio. There you can delete images completely or to the trash and rename them. This is done both with the keys and through the context menu.
https://github.com/GNOME/gthumb

Thanks for the suggestion. That looks like a useful utility for any puppy.

If the size is not intimidating, then XnView. It seems 666philb added it to PPM.
viewtopic.php?p=3884#p3884

Unfortunately i could not get it to run on Tahr32 yet so probably i need some extra libs. I will have a deeper look at it later but 70+ MB is a fatty for sure.

williams2 wrote: Fri Jan 29, 2021 12:57 am

geeqie works in Xenial, Bionic, Fossa, I don't know if it would work in Tahr or Slacko

I recall struggling with geeqie once a long time ago and not liking it's UI - but i will have another look and see if it will run on Tahr32. Thanks for the suggestion.
EDIT : Geeqie does run in Tahr32 and was accessible in PPM. Much more lightweight than gthumb or XNView and it seems to suit my needs pretty well. I prefer the layout and functionality of mmview but geeqie is a good option too.
EDIT 2 : Ooooh, looks like Geeqie has the ability to display EXIF data. That is a good feature.

Geeqie-Metadata-exif.png
Geeqie-Metadata-exif.png (246.18 KiB) Viewed 902 times
step
Posts: 536
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 55 times
Been thanked: 195 times
Contact:

Re: image view, delete, step. HowTo?? [SOLVED}

Post by step »

For quickly classifying a lot of images I use feh. The idea is to separate images into different folders named A, B, C, etc. without deleting any file, just moving the current image out of the way. You decide which image goes into which folder--the meaning of each folder is your own choice and it's the "classification tag" of the folder, say "pics to be delete", "family pics", "large size", whatever tags you need to make up as you sift through the pictures. You move the current image to folder A by pressing key a, to folder B by pressing key b, etc. When an image is moved feh displays the next image automatically. So you just sit, look at an image, press a, look at the next image press, say, a again, one more image, press c, new image, b, new image, a, ... until the whole list is exhausted. At the end all images are classified in some folder. In your case you could reserve folder A for images you want to keep, C for images to delete, and B for not so sure. Feh gives you up to 10 keys therefore 10 tags / 10 folders. Feh runs from the command line and displays a graphical window. Here's a sample setup consisting of a configuration file that defines keys a, b and c, and a script that runs feh.

File ~/.config/feh/keys

Code: Select all

action_1 a
action_2 b
action_3 c

File sift.sh (put it somewhere in your PATH and make it executable)

Code: Select all

#!/bin/sh

#font="--fontpath ${0%/*} --menu-font yudit/12"

# create folders for action keys in ~/.config/feh/keys
mkdir -p A B C

# move the next feh window to (39,0)
if command -v xdotool >/dev/null 2>&1; then
  (

    sleep 0.1
    set -e
    pid=$(pgrep -n feh)
    xid=$(xdotool search -pid $pid)
    xdotool windowmove $xid 39 0
  ) &
fi

# accepts dirpath or filepaths
exec feh \
--keep-zoom-vp \
$font \
--action1 "mv -v %N A" \
--action2 "mv -v %N B" \
--action3 "mv -v %N C" \
"$@"

Usage

With feh's window placed in the upper left corner of the screen, you want to open a terminal in the lower right corner of the screen, cd into the folder that holds the images to be classified, run sift.sh *.jpg (for a collection of JPEG images in the folder) and start pressing a or b or c until you're done. If you need more folders and actions extend ~/.config/feh/keys, the mkdir command in sift.sh and also add --action4 "mv %N D", etc. to it

The script places feh's window in the upper left corner of the screen using xdotool. If you don't have xdotool the window manager will place feh's window randomly. Finding the most confortable relative position between the feh's window and the terminal enhanced usability. You might prefer to keep the terminal to the left of feh's window. In that case change the 0,39 coordinates in the script, or reposition manually. It is possible for feh's window to cover the terminal as it advances through the pictures. This happens when the picture is very large. Nevertheless, keyboard focus will stay with the terminal, so you can keep pressing a, b, c,.. even if the current picture covers the terminal.

Last edited by step on Mon Feb 01, 2021 7:14 am, edited 2 times in total.
User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 20 times
Been thanked: 415 times

Re: image view, delete, step. HowTo??

Post by MochiMoppel »

greengeek wrote: Fri Jan 29, 2021 7:47 pm

I had not thought about using mmview for this - it is an excellent option. The Ctrl+X shortcut gives me easy deletion

That's too slow when dealing with hundreds of files. Use F4 to avoid the confirmation dialog. As command you could use rm "$@" or > "$@" (the latter reduces the file to zero length and does not remove the selected file from the list as a normal delete would do. Has some advantages)

It does tell me when exif is available but i could not see how to read it: (see edit below)
EDIT : Ahhh yes - that is what the "i" button is for. Excellent.

or View menu or F1 key.
More metadata functionality explained here

User avatar
greengeek
Posts: 1357
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 501 times
Been thanked: 185 times

Re: image view, delete, step. HowTo?? [SOLVED}

Post by greengeek »

step wrote: Fri Jan 29, 2021 8:59 pm

For quickly classifying a lot of images I use feh. The idea is to separate images into different folders named A, B, C, etc. without deleting any file, just moving the current image out of the way. You decide which image goes into which folder--the meaning of each folder is your own choice and it's the "classification tag" of the folder, say "pics to be delete", "family pics", "large size", whatever tags you need to make up as you sift through the pictures.

Just gave this a try today and it is a useful approach. In my case unfortunately the feh window was maxxed out to full screen size but even then the image was way too big to fit in the feh window so it was tricky to rate the image accurately.

The sifting function worked very well though.

I will have a play around with the feh controls and see if i can get the image to shrink (and maybe try to set a -geometry for the feh window).

I don't have xdotool installed but it was fine to use without that anyway.

Thanks for the method and script.
cheers!

step
Posts: 536
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 55 times
Been thanked: 195 times
Contact:

Re: image view, delete, step. HowTo?? [SOLVED}

Post by step »

@greengeek, you're welcome. I didn't experience oversize images but it could very well be that I always used images that were smaller than my screen. If you find the right combination of feh options let me know, please, as I do use that script myself. Feh's geometry can be set with

-g, --geometry WxH[+X+Y] Limit the window size to DIMENSION[+OFFSET]

I didn't use that option instead of xdotool to position feh's window because -g fixes the window geometry for all subsequent images. So if a picture exceeds the geometry you'll see scroll bars. But for the purpose of quickly classifying some images, setting generous dimensions and ignoring scroll bars may be good enough, and gets rid of xdotool.

Post Reply

Return to “Users”