Latest Nathan Wallpaper zapping *.png's ? [SOLVED]

Please post any bugs you have found
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

01micko said:
> Christian.. is it not the same in Wary?

Can't answer that right now, I'm in dpup 485.
Is the code you quoted above verbatim from wary 5.5 or does it contain Karl's new edits?

As well, why are you sure that it's the reshape script that's zapping the *.png's?
Could it not be related to exclusive use of the /usr/share/backgrounds directory?

I also noted that the usual small guide files found in dpup 485 in ~/.config/wallpaper are not in wary 5.5, only a couple instead 4-5. Is that a problem?

BFN.

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

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#22 Post by Karl Godt »

I have looked inside the whole scripts, and added code and changed a few things. Work in progress, but here's a small snap shot :

Karl Reimer Godt : March 2013 :
* Toggle when clicking the Clear button, to be able to bring back the PuppyPin
* Try to put common code in common.sau ( .sau for being sourced (sauce))
* Made that work
* Wallpaper slider to support seconds, minutes, hours
* Better support for Spaces in Directory Names or File Names
* slideshow is now not dependent on external scripts/wrappers

EDIT1:
Removed original .snp shot and uploaded a more robust one.
background_reshape seperately attached for the records.
Please use background_reshape by wjaguar 5 posts further down!
Attachments
Wallpaper-0.6.1-1-sp.snp2.tar.bz2
more robust now. was having issues if configuration files in /root/.config/rox*/wallpaper did not match
(11.61 KiB) Downloaded 740 times
background_reshape.bz2
for the records only. wjaguar did it much more professional.
(2.31 KiB) Downloaded 720 times
Last edited by Karl Godt on Thu 28 Mar 2013, 01:05, edited 1 time in total.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#23 Post by 01micko »

Karl,

Please hack on this version of Nathan wallpaper <<--
http://ftp.aarnet.edu.au/pub/puppylinux ... -0.6.3.pet (it's at ibiblio and other mirrors too)

That is the latest and it should be in the common repo (isn't I guess) as jamesbond added some bugfixes.

I downloaded Wary, changed to fr_CA.UTF-8, changed to a png wallpaper with no issue. I can't think of anything in the scripts (even the 6.1 versions) that would cause your problems Musher0. Just do a cross check with the ~/.package/builtin_files/netpbm to make sure all the binaries are present and accounted for. I have seen before bad calls to pngtppnm zap png files, so this is the reason I think the background_reshape script is the cause. Did you try the little experiment I posted earlier?
Puppy Linux Blog - contact me for access

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#24 Post by Karl Godt »

Micko .. the Nathan wallpaper scripts seem to be already brocken out and scattered everywhere in the default Puppies.
Really no fun !
My attempt would make it portable and only use files in APPDIR to ensure there
are no incompats with scattered pwallpaper binaries and whatsoever.
The attempt to keep things slim might not make it easy to debug and help.
I consider this wallpaper-solo-way by Barry not being comprehensible to read and understand.
Will probably hack further. Looked shortly into 0.6.3, it seems only some GTK Global Variables new.
But it is not fun.
I agree that Barry should go his own way,
but I also agree, that any distro maintainer like you should have his own package!

/me gladly refuses to hack on Barry's code further.

For Christian : There are some codelines regarding Pwidgets. Dunno if they could also be the case of the trouble.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#25 Post by Karl Godt »

Now i have found the place and time to diff the mentioned packages 0.5.4.1 and 0.6.1.1 the one christian mentioned :

Code: Select all

diff -urp wallpaper_lupu-0.5.4.1/pet.specs wallpaper-0.6.1-1/pet.specs
--- wallpaper_lupu-0.5.4.1/pet.specs	2010-07-13 03:48:21.000000000 +0200
+++ wallpaper-0.6.1-1/pet.specs	2011-09-02 00:44:56.000000000 +0200
@@ -1 +1 @@
-wallpaper_lupu-0.5.4.1|wallpaper_lupu|0.5.4.1||Desktop|116K|pet_packages-5|wallpaper_lupu-0.5.4.1.pet|+gtkdialog3,+programchooser|Set backdrop image|||official|
+wallpaper-0.6.1-1|wallpaper|0.6.1-1||Desktop|116K||wallpaper-0.6.1-1.pet|+gtkdialog4|Set backdrop image||||
diff -urp wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/AppRun wallpaper-0.6.1-1/usr/local/apps/Wallpaper/AppRun
--- wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/AppRun	2010-03-11 20:41:17.000000000 +0100
+++ wallpaper-0.6.1-1/usr/local/apps/Wallpaper/AppRun	2011-09-02 00:46:39.000000000 +0200
@@ -71,7 +71,8 @@ if [ "$#" -eq 1 ];then
 		echo "$1" > $HOME/.config/wallpaper/bg_img
 		fixwidgets -wallpaper_setter
 	else
-		exec "$APPDIR/set_bg" "$1"
+		#exec "$APPDIR/set_bg" "$1"
+		exec set_bg "$1" #110408
 	fi
 	exit
   ;;
@@ -171,10 +172,24 @@ PREVDIR="`pwd`"
 echo $OLDMODE > $HOME/.config/wallpaper/backgroundmode
 
 #add button for sidebar if installed
-if [ -f $HOME/.pwidgets/pwidgetsrc ];then
- SIDEBAR='<button><label>Sidebar</label><input file icon="applications-graphics"></input><action>/usr/local/pwidgets/widgets/plugins/sidebar/sidebar &</action></button>'
+if [ -f $HOME/.pwidgets/pwidgetsrc ];then #icon fix 20110624, also in the main xml code for "edit" and "view"
+ SIDEBAR='<button><label>Sidebar</label><input file stock="gtk-media-pause"></input><action>/usr/local/pwidgets/widgets/plugins/sidebar/sidebar &</action></button>'
 fi
 
+#show image #20110624 01micko, requires new gtkdialog
+CURRENTIMG="`cat $HOME/.config/wallpaper/bg_img`"
+ln -sf $CURRENTIMG /tmp/current_wallpaper_selection.jpg
+
+swapimagefunc()
+{
+	rm -f /tmp/current_wallpaper_selection.jpg
+	ISIMAGE="`echo $IMAGE|grep -iE 'jpg$|png$|jpeg$|gif|JPEG$|JPG$|tiff$|background$'`"
+	if [ "$ISIMAGE" = "" ];then IMAGE="/usr/share/doc/puppylogo96.png" #if file is not an image
+	fi
+	ln -sf $IMAGE /tmp/current_wallpaper_selection.jpg
+}
+export -f swapimagefunc
+
 cd "$DIR"
 export BG_DLG="
 <window title=\"$LOC_MAIN\" icon_name=\"preferences-desktop-wallpaper\">
@@ -207,18 +222,22 @@ export BG_DLG="
    <vbox>
     <frame $LOC_FILE_FRAME>
      <chooser>
-      <height>300</height><width>500</width>
+      <height>180</height><width>500</width>
       <variable>IMAGE</variable>
       <action>$APPDIR_ESC/slideshow -stop</action>
       <action>$APPDIR_ESC/set_bg \"\$IMAGE\"</action>
       <action>echo \"\$IMAGE\" > \$HOME/.config/wallpaper/bg_img</action>
-      <action type=\"refresh\">TEXT</action>
+      <action signal=\"button-release-event\">swapimagefunc</action>
+      <action signal=\"button-release-event\" type=\"refresh\">PIXMAP</action>
      </chooser>
      <frame $LOC_CURRENT_IMAGE>
-      <text>
-       <input>cat $HOME/.config/wallpaper/bg_img</input>
-       <variable>TEXT</variable>
-      </text>
+      <hbox height-request=\"190\" homogeneous=\"true\">
+       <pixmap>
+        <height>180</height><width>270</width>
+        <variable>PIXMAP</variable>
+        <input file>/tmp/current_wallpaper_selection.jpg</input>
+       </pixmap>
+      </hbox>
      </frame>
     </frame>
    </vbox>
@@ -246,12 +265,12 @@ export BG_DLG="
      $SIDEBAR
      <button>
      <label>$LOC_EDIT</label>
-      <input file icon=\"applications-graphics\"></input>
+      <input file stock=\"gtk-edit\"></input>
       <action>$IMGEDITOR \$IMAGE &</action>
      </button>
-     <button>
+     <button height-request=\"30\">
       <label>$LOC_VIEW</label>
-      <input file icon=\"image-x-generic\"></input>
+      <input file>\"/usr/local/lib/X11/mini-icons/mini-eye.xpm\"</input>
       <action>$VIEWER \$IMAGE &</action>
      </button>
      <button>
@@ -272,7 +291,7 @@ export BG_DLG="
 </window>
 "
 
-gtkdialog3 --program BG_DLG
+gtkdialog4 --program BG_DLG
 
 cd "$PREVDIR"
 
diff -urp wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/functions wallpaper-0.6.1-1/usr/local/apps/Wallpaper/functions
--- wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/functions	2008-05-27 09:15:30.000000000 +0200
+++ wallpaper-0.6.1-1/usr/local/apps/Wallpaper/functions	2011-09-02 00:47:24.000000000 +0200
@@ -7,7 +7,7 @@ cd "${APPDIR}"
 APPDIR="`pwd`"
 cd "${CURDIR}"
 
-VERSION="0.5"
+VERSION="0.6.1"
 
 # Make sure working space and files are in place
 [ ! -d $HOME/.config/wallpaper ] && mkdir $HOME/.config/wallpaper
@@ -64,7 +64,7 @@ export ABOUT_DLG="
  </vbox>
 </window>
 "
-gtkdialog3 --program ABOUT_DLG &
+gtkdialog4 --program ABOUT_DLG &
 }
 
 ### end About ###
@@ -159,7 +159,7 @@ export PREFS_DLG="
  </vbox>
 </window>
 "
-gtkdialog3 --program PREFS_DLG > $HOME/.config/wallpaper/preferences
+gtkdialog4 --program PREFS_DLG > $HOME/.config/wallpaper/preferences
 rm -f $HOME/.config/wallpaper/int
 }
 
diff -urp wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/locale/english.po wallpaper-0.6.1-1/usr/local/apps/Wallpaper/locale/english.po
--- wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/locale/english.po	2008-05-26 10:42:43.000000000 +0200
+++ wallpaper-0.6.1-1/usr/local/apps/Wallpaper/locale/english.po	2011-06-24 11:44:14.000000000 +0200
@@ -26,8 +26,8 @@ export LOC_HELP="Help"
 
 # Image file frame
 export LOC_FILE_FRAME="Image file"
-# Current image frame
-export LOC_CURRENT_IMAGE="Current image"
+# Current image frame #now preview
+export LOC_CURRENT_IMAGE="Preview"
 # Mode frame
 export LOC_MODE="Mode"
 
diff -urp wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/set_bg wallpaper-0.6.1-1/usr/local/apps/Wallpaper/set_bg
--- wallpaper_lupu-0.5.4.1/usr/local/apps/Wallpaper/set_bg	2010-03-11 20:34:39.000000000 +0100
+++ wallpaper-0.6.1-1/usr/local/apps/Wallpaper/set_bg	2011-08-04 07:26:01.000000000 +0200
@@ -6,27 +6,37 @@ APPDIR=`dirname "$0"`
 cd "${APPDIR}"
 APPDIR="`pwd`"
 cd "${CURDIR}"
-IMAGE="$1"
 
-[ "$1" = "-clear" ] && IMAGE=""
+if [ "$1" = "-clear" ];then
+ cat $HOME/.config/rox.sourceforge.net/ROX-Filer/pb_default | grep -v '<backdrop' > $HOME/.config/wallpaper/pb
+ mv -f $HOME/.config/wallpaper/pb $HOME/.config/rox.sourceforge.net/ROX-Filer/pb_default
+ rox -p=default
+ echo "[none]" > $HOME/.config/wallpaper/bg_img
+ exit
+fi
 
 MODE="`cat $HOME/.config/wallpaper/backgroundmode`"
-[ "$MODE" = "" ] && MODE="Stretch"
+[ "$MODE" = "" ] && MODE="Scale"
 [ "$MODE" = "Centred" ] && MODE="Centre"
 [ "$MODE" = "Scaled" ] && MODE="Scale"
 
+#w482 BK now have script that truncates an image vertically so that it has the right dimensions
+#for a widescreen...
+if [ -x /usr/sbin/background_reshape ];then #legacy compatibility
+ if [ "$MODE" = "Stretch" ];then
+  /usr/sbin/background_reshape ${1}
+ fi
+fi
+
 rox --RPC << EOF
 <?xml version="1.0"?>
 <env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
  <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
   <SetBackdrop>
-   <Filename>$IMAGE</Filename>
+   <Filename>$1</Filename>
    <Style>$MODE</Style>
   </SetBackdrop>
  </env:Body>
 </env:Envelope>
 
 EOF
-
-echo "$IMAGE" > $HOME/.config/wallpaper/bg_img
-
Only in wallpaper-0.6.1-1/usr/local/apps/Wallpaper: wallpaper.png
And I am 99% sure it was the call to /usr/sbin/background_reshape ${1} that truncated the .png . Even if Christian has incompatible tools or libraries installed, the missing call to the reshape script , that only executes if widescreen detected -otherwise exits before- will likely saved his background joy by the older pkg. Have no widescreen, only normal ones, probably I can force it to execute by commenting the test line.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#26 Post by Karl Godt »

Nope, it is something with

Code: Select all

pngtopnm "${IMAGEPATH}"_original/ORIGINAL-"${IMAGEBASE}" | ${PAMCUT} -left=0 -top=${TOP} -bottom=${BOTTOM} | pnmtopng > "${IMAGEFILE}"
:LOL:
Attachments
garbledscreen.jpg
(55.97 KiB) Downloaded 1553 times

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#27 Post by wjaguar »

Karl Godt wrote:Work in progress, but here's a small snap shot :
So I rewrote the eldritch horror which was "background_reshape". This new version should not be eating up anyone's files anymore. :-)

Probable cause was absence of some program used in the conversion chain - it was not checked against, and then conversion failure would leave the file truncated to 0.
Attachments
background_reshape.gz
(1.65 KiB) Downloaded 815 times

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

#28 Post by musher0 »

Thanks, guys. I'll peruse your edits when I'm back on wary 5.5.

I did come up with a solution, even though I'm not as advanced a code-writer as you people are.

Edit in reaction to Karl's comment, top of next page.
Indeed, I only have the merit of an "arranger" rather than that of a "composer", since it is an adaptation of the existing set_bg routine in Nathan's wallpaper utility, which in turn is itself an adaptation of the routine quoted in the ROX-Filer Manual, Appendix C. SOAP RPC.


This is a K.I.S.S. right-click script. It:
*avoids any language (thus any utf decimals ca-fuddle)
* sets any jpg or png at
* only the middle of the screen (it uses ROX's default utility to set the position).

Simple: if your pic is too big for your screen resolution, it will still be in the middle
If your pic is smaller, the default ROX color will provide a border.

Moral of this story: use mtpaint to resize your pictures to your taste, according to your artistic sense or impulse towards the picture. Automatic cutting can and will produce ugly results, even if it is a computer-language feat.

Also, who needs light grey all the time? If you want to change the default background color in ROX, look at line 40 in /root/.config/rox.sourceforge.net/ROX-Filer/Options.
It accepts 12-bit or 6-bit color codes, or the color names defined in /root/.rgb.txt. Now, this one should be a link from /usr/X11R7/lib/X11/rgb.txt (but it rarely is...) There you have +/- 256 pre-defined colors, plainly described in human language, to insert at Options line 40. That should inspire your respect. (:-) A good start.

Despite some research on the Web, I couldn't find a 12-bit color table, which the ROX-Filer Options seems to need. I have done some tests, and the following are satisfactory.
For ex., "chocolate4", or #8B4513, will become #8B0045001300 at line 40 of the ROX-Filer Options. I have also had good results with #8B4513000000, i.e. the hex color code followed by a filler of 6 zeros. (An explanation by a color expert will be welcome!)

Illustration attached.

BFN

musher0
~~~~~~~~~~~~~
P.S. For a more recent version, please see link in 1st message of page 3. Thank you.
Attachments
Nature-sauvage-Qc-1152x864_backdrop.jpg
(40 KiB) Downloaded 2261 times
Last edited by musher0 on Sat 30 Mar 2013, 07:42, edited 3 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#29 Post by musher0 »

Thanks to you wjaguar and Karl_Godt, problem solved ! :)

Both your "reshape" scripts do an excellent job, although wjaguar's feels snappier.

Again, many thanks! You guys made my day! :D

Best.

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

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#30 Post by Karl Godt »

wjaguar, your's showing the hand of a professional ! Many thanks !

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

#31 Post by musher0 »

Hello again.

You can find the latest version of my two little backdrop setting utilities for the ROX environment here: http://murga-linux.com/puppy/viewtopic.php?t=85084

Best.

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

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#32 Post by Karl Godt »

musher0 wrote: I did come up with a solution, even though I'm not as advanced a code-writer as you people are.

This is a K.I.S.S. right-click script. It:
*avoids any language (thus any utf decimals ca-fuddle)
* sets any jpg or png at
* only the middle of the screen (it uses ROX's default utility to set the position).
You just took /usr/sbin/set_bg and "sell" it from the outside "as yours" . I am not going to look into your .pet s anymore. In fact, you really might have a .wh. blocking a needed binary or uninstalled one.

/usr/sbin/background_reshape is needed by /root/.xinitrc :

Code: Select all

#w482 reshape background image if widescreen...
[ $PUPMODE -eq 5 ] && /usr/sbin/background_reshape
and truly it was buggy in special circumstances.

This is what i got running a test dpup-001 pfix=ram in /tmp/xerrs.log as an example :
dc: stack underflow
expr: syntax error
/usr/sbin/background_reshape: line 44: [: -ge: unary operator expected
dc: stack underflow
dc: stack underflow
dc: stack underflow
dc: stack underflow
expr: non-numeric argument
/usr/sbin/background_reshape: line 70: pamcut: command not found
/usr/sbin/background_reshape: line 70: jpegtopnm: command not found
/usr/sbin/background_reshape: line 70: pnmtojpeg: command not found
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

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

#33 Post by musher0 »

Karl Godt wrote:
> You just took /usr/sbin/set_bg and "sell" it from the outside "as yours" . I am not going to look into your .pet s anymore. In fact, you really might have a .wh. blocking a needed binary or uninstalled one.

Hello, Karl.

Think what you will. I'll simply re-state here the edit of my previous message.

Edit in reaction to Karl's comment, top of next page.
Indeed, I only have the merit of an "arranger" rather than that of a "composer", since it is an adaptation of the existing set_bg routine in Nathan's wallpaper utility, which in turn is itself an adaptation of the routine quoted in the ROX-Filer Manual, Appendix C. SOAP RPC.


So, given that the ultimate source is the ROX-Filer manual itself, it is very unlikely that use my little backdrop utilities will provoke "a .wh. blocking" of anything.

I apologize for not having been clearer earlier.

Beware of attacking anybody's reputation, Karl. "it might come back to bite you", as the English proverb says.

Respectfully submitted,

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

Post Reply