Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 16 Dec 2017, 07:27
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Pho image viewer 1.0
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
don570


Joined: 10 Mar 2010
Posts: 4811
Location: Ontario

PostPosted: Sat 11 Nov 2017, 12:31    Post subject:  Pho image viewer 1.0  


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/

Quote:
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.
pho-64bit.pet
Description  64 bit puppy linux version
pet

 Download 
Filename  pho-64bit.pet 
Filesize  36.91 KB 
Downloaded  33 Time(s) 
pho-32bit.pet
Description  32 bit version - don't use with precise puppy
pet

 Download 
Filename  pho-32bit.pet 
Filesize  34.04 KB 
Downloaded  41 Time(s) 
screenshot-pho.png
 Description   Choose a format
 Filesize   31.41 KB
 Viewed   270 Time(s)

screenshot-pho.png


Last edited by don570 on Thu 16 Nov 2017, 12:57; edited 1 time in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4811
Location: Ontario

PostPosted: Mon 13 Nov 2017, 20:48    Post subject:  

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:
pho -k *.jpg

_____________________________________
Here are instructions I found by author to make a captions file...

Quote:
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.

Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 92

PostPosted: Tue 14 Nov 2017, 00:58    Post subject:  

Doesn't work. I get error "No files with that extension were found" though folder contain .jpeg files. Why choose a format at all?
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11280
Location: Gatineau (Qc), Canada

PostPosted: Tue 14 Nov 2017, 09:31    Post subject:  

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
_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4811
Location: Ontario

PostPosted: Wed 15 Nov 2017, 19:19    Post subject:  

Quote:

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:
pho -r *.JPG

________________________________________________

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

Code:
pho -r *.JPG  *.jpg  *.jpeg


_________________________________________
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11280
Location: Gatineau (Qc), Canada

PostPosted: Wed 15 Nov 2017, 19:49    Post subject:  

don570 wrote:
Quote:
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:
pho -r *.JPG
_______________________________________________

Also I believe that pho will open multiple extensions . I'll have to test this.
Code:
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:
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 Wink 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? Smile

BFN

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4811
Location: Ontario

PostPosted: Wed 15 Nov 2017, 20:40    Post subject:  

Thanks for tip. I'll try it out tonite.
regex expansion isn't something I know much about. Embarassed
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.

________________________________________________
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11280
Location: Gatineau (Qc), Canada

PostPosted: Thu 16 Nov 2017, 04:26    Post subject:  

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
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4811
Location: Ontario

PostPosted: Thu 16 Nov 2017, 13:02    Post subject:  

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

Re-posted the pet files.
_________________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0904s ][ Queries: 14 (0.0050s) ][ GZIP on ]