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 Wed 23 Oct 2019, 22:54
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Alternatives to IrfanView in PuppyLinux:
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 3 [37 Posts]   Goto page: Previous 1, 2, 3
Author Message
puppy_apprentice


Joined: 07 Feb 2012
Posts: 300

PostPosted: Tue 06 Nov 2018, 04:43    Post subject:  

musher0 wrote:
"file://localhost" has 16 characters, not 7. Cutting at 7 chars, mtpaint does
not know how to interpret the "localhost" part.


Om my machine (firefox) path is always:

Code:
file:///mnt/etc.


so URL have to be shorten for 16 or 7 depends if there will be "localhost" or not.

musher0 wrote:
Also, I think it would need an exit button as well, and / or or some way to
close the yad tray icon -- on the icon -- once we have finished. Because,
as it is, it stays there forever; I had to run < killall yad > to get rid of it.


You can close YAD icon by MMB (middle mouse button) or wheel.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Tue 06 Nov 2018, 09:46    Post subject:  

Hi.

As I recall, the real expression is file://localhost; file:/// is shorthand.

I suppose the script will have to accommodate the browser's way of
expressing it. May I suggest one of the five ways to detect it, here.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Semme


Joined: 07 Aug 2011
Posts: 8021
Location: World_Hub

PostPosted: Tue 06 Nov 2018, 10:19    Post subject:    

Cool Good stuff PA -- I like!

_________________
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<
Back to top
View user's profile Send private message 
puppy_apprentice


Joined: 07 Feb 2012
Posts: 300

PostPosted: Tue 06 Nov 2018, 10:22    Post subject:  

+ exit
+ check for 'localhost'

Code:
#!/bin/sh
# /root/my-applications/bin/browser-picture-viewer.sh
# Author: "Puppy_Apprentice", Nov. 5 2018
# Source: http://www.murga-linux.com/puppy/viewtopic.php?p=1009207#1009207
####

if [[ ! -e "index.html" ]]; then
    echo -e "<!DOCTYPE html>\n<html>\n<head>\n<title>Browser Picture Viewer</title>\n</head>\n<frameset cols=\"*,235px\">\n<frame src=\"\" name=\"view\">\n<frame src=\"gallery.html\">\n</frameset>\n</html>" >index.html
fi

LIST=$(ls -1 *.{jpg,png} 2> /dev/null)

echo -e "<!DOCTYPE html>\n<html>\n<body>" >gallery.html
echo -e "<h3>Pictures from $PWD dir:</h3>\n<br>" >>gallery.html
for Line in $LIST
do
   echo "<a href=\"$Line\" target=\"view\"><img src=\"$Line\" alt=\"$Line\" width=\"196\" height=\"110\"></a>" >>gallery.html
done

echo -e "</body>\n</html>" >>gallery.html

defaultbrowser $PWD/index.html & # but browser should know frames

send_to() {
    if which xclip >/dev/null 2>&1; then
       clip=$(xclip -selection clipboard -o)
    else
       clip=$(xsel --clipboard -o)
    fi

    if [[ $clip =~ "localhost" ]]; then
       clip=${clip:16}
    else
       clip=${clip:7}
    fi

    gxmessage -name "Send to..." -nearmouse -buttons "mtPaint:42,PeasyPrint:52,Cancel:62,Exit:72" "$clip"

    case $? in
       42) mtpaint "$clip";;
       52) peasyprint "$clip";;
       72) killall yad --notification --kill-parent --listen --image="/root/.usr/share/midi-icons/paint48.png" --text="Send to..." --command="sh -c send_to";;
       *)
    esac

}

export -f send_to

PIPE="/tmp/snippets_${USER}_${$}"
mkfifo "$PIPE"
exec 3<> "$PIPE"
trap 'echo "quit" >&3; rm -f "$PIPE"' EXIT

yad --notification --kill-parent --listen --image="/root/.usr/share/midi-icons/paint48.png" --text="Send to..." --command="sh -c send_to" <&3

exit
Screenshot_2018-11-06_151505.jpg
 Description   
 Filesize   65.54 KB
 Viewed   200 Time(s)

Screenshot_2018-11-06_151505.jpg

browser-picture-viewer.sh.gz
Description  fake gz
gz

 Download 
Filename  browser-picture-viewer.sh.gz 
Filesize  1.72 KB 
Downloaded  149 Time(s) 
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Tue 06 Nov 2018, 10:43    Post subject:  

Thanks, Puppy_Apprentice. The features that you added work well.

If I may, would it be possible to stabilize the picture shown? I mean:
separate it from the scrolling list of pictures?

Of course the chosen picture has to change when a new one is chosen, but
while we choose (scrolling down the list on the right), could it stay in place
and not scroll down too? I find it a bit confusing the way it is.

On the other hand, if it's doing this only on my old Opera, don't bother.

TIA. BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Tue 06 Nov 2018, 11:07    Post subject:  

Surprisingly, the links2 browser does this separation naturally, by default.
links-picture-viewer.jpg
 Description   
 Filesize   85.11 KB
 Viewed   186 Time(s)

links-picture-viewer.jpg


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
puppy_apprentice


Joined: 07 Feb 2012
Posts: 300

PostPosted: Tue 06 Nov 2018, 13:12    Post subject:  

I think it is browser dependent. Sometimes browsers render pages differently.

You can check this part of code:

Code:
if [[ ! -e "index.html" ]]; then
   echo -e "<!DOCTYPE html>\n<html>\n<head>\n<title>Browser Picture Viewer</title>\n</head>\n<frameset cols=\"*,235px\">\n<frame src=\"\" name=\"view\">\n<frame src=\"gallery.html\">\n</frameset>\n</html>" >index.html
fi


Especialy this part:
Code:
<frameset cols=\"*,235px\">


Thumnails part is 235 pixels wide.
Viewer part has '*' symbol that means window - 235 pixels.
Try to put instead of '*' eg. 1024 (or something near your screen size) - 235.

And this part:
Code:
<frame src=\"\" name=\"view\">\n<frame src=\"gallery.html\">


Change to:
Code:
<frame src=\"\" name=\"view\" scrolling=\"yes\">\n<frame src=\"gallery.html\" name=\"thumbs\" scrolling=\"yes\">


Maybe this help. Another solution is to use iFrames instead of Frames. But i'm not sure if Opera will render iFrames the same like Mozilla family browsers. Or maybe some JavaScript or CSS code is needed.

BTW. In Firefox you can move middle slider to change width of two parts. And F11 change view to full screen.

My browser viewer has one problem. It has to render all thumbnails. If pictures are very big and you have them many in directory loading will be very slow and memory usage big, especially without HDD and swap partition. But it is possible to make 'select' gadget instead of thumbnails.
Screenshot_2018-11-06_175006.jpg
 Description   Middle slider movable.
 Filesize   104.09 KB
 Viewed   185 Time(s)

Screenshot_2018-11-06_175006.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 3 [37 Posts]   Goto page: Previous 1, 2, 3
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.0782s ][ Queries: 13 (0.0198s) ][ GZIP on ]