Pho image viewer 1.0

Paint programs, vector editors, 3d modelers, animation editors, etc.
Post Reply
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Pho image viewer 1.0

#1 Post by don570 »


Pho image viewer 1.0
French translation inside

Note: Tested to work on Slacko 32 bit and 64 bit versions.
Should work with recent kernels. Needs Rox file manager.
When tested on Precise Puppy it did not work , because of problem with keybindings.

I have made a right click utility using pho to show each image in a folder.
There is a warning if no images are found with the appropriate extension.

Pho can be used as a slideshow.
A fast image viewer , plus it can create a captions file which
contains a list of files in a folder and associated captions(using keybinding k)

Note: To create a captions file, you type a caption for each image in your folder.
First step is to browse through your folder of images.
Stop at an image you want to caption and press k key.
Type in the caption field that pops up. Click to return to browsing.
Continue using this method to create captions for all your images in folder if you wish.
When you quit (using q key), the captions file will be created inside the folder of images.


Developer website
http://www.shallowsky.com/software/pho/
How to use pho
Usage: pho *.jpg (or whatever).
It will show the first image, scaled for your screen if needed. Then the following keys work:

space
Go to next image.
backspace, -
Go to previous image.
r, t, right-arrow
Rotate right (clockwise).
R, T, l, L, left-arrow
Rotate left (counter-clockwise).
up-arrow
Rotate 180 degrees.
home
Go back to the first image.
d
Bring up a delete dialog (another d deletes the file)
i
Show information about the image (includes EXIF info and JPEG comment, if any).
0-9
Tag the image with a number. These tag lists will be printed out when you exit.
f
Toggle in and out of "full size mode" (show the image at its native size, even if that's too big to fit on screen)
F
Toggle in and out of "full screen mode" (make the image as big as it can be and still fit on the screen).
p
Toggle in and out of Presentation Mode (full screen, no mouse or window borders)
-, /
Zoom out, to half size
+, =, *
Zoom in, to double size o
Pop up a file selector to change the working file list (New replaces all the old images, Add just adds new files to the list)
g
Run gimp on this image (or set PHO_REMOTE to an alternate command).
q
Quit.
Attachments
screenshot-pho.png
Choose a format
(31.41 KiB) Downloaded 431 times
pho-32bit.pet
32 bit version - don't use with precise puppy
(34.04 KiB) Downloaded 244 times
pho-64bit.pet
64 bit puppy linux version
(36.91 KiB) Downloaded 233 times
Last edited by don570 on Thu 16 Nov 2017, 16:57, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

I tested pho (32bit) on tahr puppy and it worked well.

_________________________________________________

Next I tested on Dpup Stretch 32 bit
stretch-7.0.0a2-k4.9.61-10Nov2017.iso

And it worked however it doesn't generate a captions file unless
I type in terminal

Code: Select all

pho -k *.jpg
_____________________________________
Here are instructions I found by author to make a captions file...
Using Pho to tag photos with keywords

This is a description of how I use Pho to tag my photos. This is by no
means the only way to do this, and I welcome hearing about better solutions.

I run pho -k *.jpg in a directory. Keywords mode shows each photo
at a smaller-than-usual size, and brings up a Keywords dialog at the
same time. The Keywords dialog has a Caption field at the top,
and a list (initially only one) of numbered keyword fields below it.
Initially, focus is in the first keyword text field of the dialog.

I look at the first photo and say "Oh, that's a bluebird", and type
"bluebird" in the text field. So keyword #0 will be "bluebird".
At this point, the keyword doesn't apply to this photo, because
the 0 button isn't pressed. Pho should probably notice that I'm typing
something and automatically toggle the button, but for now, I do it
either with the mouse or by pressing <Ctrl>0. In the Keywords dialog,
<Ctrl> and any digit will toggle the corresponding button;
<Ctrl><Alt> and any digit will toggle ten plus the corresponding number.

Okay, now my first photo is tagged with Bluebird. I move on to the next
image. Since hitting spacebar while I'm in that text field will just
add a space to the keyword ("bluebird "), I use <Ctrl>Space.
(Of course, I could also move the mouse into the image window and hit
the spacebar there, but that's more hassle. The goal is to drive the
whole process from the keyboard without needing to switch to the mouse.)

The second image has a bluebird too, but now it's sitting on a maple
tree with the leaves in beautiful fall colors. The Keywords dialog
still shows "bluebird" as the 0th tag, but the 0 button isn't
pressed. I hit <Ctrl>Space to tag it as a bluebird photo. But I want
some more tags for this image, too. So I hit Return, which opens up
a tag #1 (focus is in the text field already) and type "maple tree".
The 1 button is already selected -- pho assumes that if I'm adding a
tag, it's because it applies to this image. I hit Return again and
add a "fall colors" tag. This image now has three tags, 0, 1 and 2.

<Ctrl>Space moves to the next image. That's the tree but the bluebird
has flown away. I hold <Ctrl> down and type 1 2 to add the "maple tree"
and "fall colors" tags.

At any time, if an image has a unique, particularly interesting story
involved with it I can add something to the Caption field. Captions
aren't shared among images; they're unique to each image. I don't use
captions myself; they were added for another pho user who uses a
different tagging scheme from mine.

I continue tagging images, and if I get to the last image in the
directory and haven't had more than 10 tags, I'm happy. When there
are more than 10 tags, 0-9, it gets a little more complicated: I
have to remember to use <Ctrl><Alt>. That still works fine but
sometimes switching <Alt> on and off (for an image where I want
tag 5 and also tag 12) can sometimes get confusing. Sometimes I
even go to the mouse for tags above 9, though I try not to.
If the tag list gets quite long (especially if it goes over 20,
though that's rare), I may make a note of the last tagged image,
quit and restart pho from where I left off with a fresh tags list.

KEYWORDS FILES

Okay, I've been through the whole directory and tagged everything,
and pho gets to the last image and quits. What now?

Pho prints all the tags on standard output, something like this:

bluebird: img_6938.jpg img_6939.jpg

maple tree: img_6939.jpg img_6940.jpg

fall colors: img_6939.jpg img_6940.jpg img_6953.jpg

(It also prints other things, like captions, rotation information and
such, but that's not relevant to this document.)

I save that list in a file called Keywords. I use the mouse to select
all the keywords info pho has just printed out, cat > Keywords and
paste the pho output into the file, then close it with <Ctrl>d.

Yes, pho should save it to keywords directly, and should read in
initial information from a Keywords file if it exists. It wouldn't
even be that hard to add; I just haven't gotten around to it.

If there's already a Keywords file (perhaps it's a really big photo
collection and I stopped halfway through because I had too many
keywords piling up), I use cat >> Keywords to append to the file.

SEARCHING KEYWORDS FILES

Okay, great, now I have a big hierarchy of directories that each have
a file named Keywords along with a lot of JPG files. What now?

I have a little script called fotogr,
https://github.com/akkana/scripts/blob/master/fotogr
that recursively searches directories and looks for keywords (or key
phrases) inside any file named Keywords.

So if I want to know what photos I took of lakes in 2012, I cd to
~/Images/2012 and type fotogr lake.

fotogr isn't very smart, though: it can't do any boolean logic, like
looking for photos that include a lake AND fall color. That's
something I've been wanting to add, but haven't come up with a
sensible syntax for it. yet.

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#3 Post by phat7 »

Doesn't work. I get error "No files with that extension were found" though folder contain .jpeg files. Why choose a format at all?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

phat7 wrote:Doesn't work. I get error "No files with that extension were found" though folder contain .jpeg files. Why choose a format at all?
jpeg files, eh? ;)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#5 Post by don570 »

phat7 wrote:
Doesn't work. I get error "No files with that extension were found" though folder contain .jpeg files. Why choose a format at all?
jpeg files, eh? Wink

Also it is possible that jpeg files use capital letters JPG.

It is easy to change script . Just add a new radio button to script,
then add a new test statement to viewer function to open that extension

Code: Select all

pho -r *.JPG
________________________________________________

Also I believe that pho will open multiple extensions . I'll have to test this.

Code: Select all

pho -r *.JPG  *.jpg  *.jpeg
_________________________________________

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

don570 wrote:
phat7 wrote:
Doesn't work. I get error "No files with that extension were found"
though folder contain .jpeg files. Why choose a format at all?
jpeg files, eh? Wink
Also it is possible that jpeg files use capital letters JPG.

It is easy to change script . Just add a new radio button to script,
then add a new test statement to viewer function to open that extension

Code: Select all

pho -r *.JPG
_______________________________________________

Also I believe that pho will open multiple extensions . I'll have to test this.

Code: Select all

pho -r *.JPG  *.jpg  *.jpeg
_________________________________________
Hi don.

There is no need to add a radio button, IMO. May I suggest that you use the
built-in regex expansion capacity. Something like:

Code: Select all

pho -r *.[Jj]*[Gg]
(line 35), and similarly for the other image types.

pho will then pick up any jpg, JPG, jpeg, JPEG, or even (God forbid!) any
JpEg ;) picture.

As you mention, some pictures coming from the WhineDose world have their
extension type capitalized, and this regex trick is solving that problem as well.

IHTH.

~~~~~~~~~~~~~~~~~~~~
@phat7: You may have a point! Indeed, why choose a format? :)

BFN
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#7 Post by don570 »

Thanks for tip. I'll try it out tonite.
regex expansion isn't something I know much about. :oops:
Hopefully the expansion doesn't slow down pho because there's a lot of files to test.
If the folder has say 1000 files --> *.[Jj]*[Gg] is equivalent to about 4 extensions to test for. So it should be quick.

________________________________________________

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

Hi don570.

I have used regex substitutions in a few scripts, e.g. with awk or grep, and there never
seemed to be a speed problem. Nothing noticeable, anyway.

There are many articles on regular expressions on the Web, but for a fun intro, maybe
try http://www.rexegg.com?

Good luck!
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

I changed the wrapper script to open more files as musher0 suggested.
The speed of loading is nice.

Re-posted the pet files.
_________________________________________________

Post Reply