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 Tue 16 Sep 2014, 19:32
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Latest Nathan Wallpaper zapping *.png's ? [SOLVED]
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [33 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
musher0


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

PostPosted: Tue 26 Mar 2013, 12:03    Post subject:  

in any case, i can confirm that this wallpaper utility works in wary 5.5 : http://distro.ibiblio.org/puppylinux/pet_packages-5/wallpaper_lupu-0.5.4.1.pet

It doesn't show the pictures, but if you put links in the appropriate ROX-types (see above), it does.
You just have to think "picture to wallpaper" instead of "wallpaper from picture".

Meaning:
    Make the links as indicated above.
    Browse to any picture folder.
    Right-click on the eye in the ROX-Filer, the thumbs will show.
    Click twice on the "+" icon to make the thumbs the largest.
    Find a nice picture.
    Right-click on it.
    Click on "wallpaper" in the sub-menu,

and voilà, you new wallpaper is in place.

Minor caveat:
For now,don't do anything involving a recycling of the PuppyPin directly.
At your earliest convenience, recycle the X server, and
the name of your picture will be properly registered in PuppyPin.

Best.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 26 Mar 2013, 17:26    Post subject:  

wjaguar wrote:
Karl Godt wrote:
Have
export LC_ALL=fr_CA.UTF-8
and then it gives me
expr: non-numeric argument
/usr/sbin/background_reshape: line 59: [: -ge: unary operator expected

This happens because the script expects decimal separator to be ".", and in some locales it is "," instead. And a chain reaction of unexpected behavior follows.

To prevent these things from happening, it is best to put "export LC_NUMERIC=C" at the beginning of a script, if it's making any kind of floating-point calculations.

Yeah found myself in there. If somebody would have told me, i had submitted a patch therefore, i could not remember it anymore Embarassed .

Anyway the script seems to work to backup screwed wallpapers Very Happy .

BUT : Filename with spaces are not supported throughout the whole script,
and instead of math gymnastics by dc it seems to be able to achieve all this with ash and bash math without the need for a delimiter for cut.
These two shell gymnastics worked for me, too :
Code:
# echo "123,456" | awk -F '[[:punct:]]' '{print $1}'
123
# echo "123,456" | sed 's%[[:punct:]].*%%'         
123
#


*
Have still a hard time to understand these LC_* and .UTF-8 things .
As far as I have read the docs, ".UTF-8" was always the extension syntax, dunno why some distros had used .utf8, .utf-8 or .UTF8 . UTF-8 seems not to work for German in Puppy-4.3.x .

Anyway, wjaguar : You are doing a great job on mtpaint. Thanks muchly for it !
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 26 Mar 2013, 21:42    Post subject:  

Hello, all.

Sorry for the emotional outburst earlier today.

I've checked all versions 0.6.x of Wallpaper and the 01micko's "simple wallpaper seter" in wary 5.5 and they all have the same *.png problem. As to pwallpaper, you're out of luck if you want a backfdrop that's not in /usr/share/backgrounds.

If I understand correctly, you're saying it's a problem with the background-reshape script, that interprets decimals wrongly. I looked at BK's code : isn't there a way to make that dc calculator use rounded numbers ? Or use another console calculator utility that does ?

Just a thought. BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Tue 26 Mar 2013, 21:49    Post subject:  

Karl, your patch is in slacko:-
Code:
#!/bin/sh
#Barry Kauler 2009
#the background image is at /usr/share/backgrounds/default.jpg
#this may have the wrong dimensions to suit either a 'normal' or a 'widescreen' monitor.
#for now, keep this simple, assume image is suitable for normal screen, truncate vertically
#if widescreen.
#v424 fix maths.
#v424 move ORIGINAL-* images to /usr/share/backgrounds_original
#110831 support png images.
#111013 Karl Godt: 'dc' can return , instead of . in numeric values, for non-english locale.

export LANG=C #111013 fix for 'dc'.

#accept optional image file as passed param...
[ -f /usr/share/backgrounds/default.png ] && IMAGEFILE="/usr/share/backgrounds/default.png"
[ -f /usr/share/backgrounds/default.jpg ] && IMAGEFILE="/usr/share/backgrounds/default.jpg"
[ $1 ] && IMAGEFILE="$1"
[ "$IMAGEFILE" = "" ] && exit

#v423 precaution, if someone has chosen the backup original...
[ "`echo -n "$IMAGEFILE" | grep 'ORIGINAL'`" != "" ] && exit

IMAGEPATH="`dirname $IMAGEFILE`"
mkdir -p "${IMAGEPATH}_original" #v424
IMAGEBASE="`basename $IMAGEFILE`"
IMAGEEXT="`echo -n "$IMAGEBASE" | rev | cut -f 1 -d '.' | rev`"

#[ "$IMAGEEXT" != "jpg" ] && [ "$IMAGEEXT" != "jpeg" ] && [ "$IMAGEEXT" != "JPG" ] && [ "$IMAGEEXT" != "JPEG" ] && exit
case $IMAGEEXT in
 jpg|jpeg|JPG|JPEG) IMAGEEXT='jpg' ;;
 png|PNG) IMAGEEXT='png' ;;
 *) exit ;;
esac

#first boot, maybe trying different video modes, so this causes reset each time...
if [ ! -f ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} ];then #v424
 cp -f ${IMAGEFILE} ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} #v424
else
 cp -f ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} ${IMAGEFILE} #restore. v424
fi

if [ "$IMAGEEXT" = "jpg" ];then
 IMAGEDIMS="`jpegtopnm ${IMAGEFILE} 2>/dev/null | pamfile 2>&1 | grep 'stdin:' | tr -s ' ' | cut -f 2 -d ',' | cut -f 2,4 -d ' '`" #ex: 1200 800
else
 IMAGEDIMS="`pngtopnm ${IMAGEFILE} 2>/dev/null | pamfile 2>&1 | grep 'stdin:' | tr -s ' ' | cut -f 2 -d ',' | cut -f 2,4 -d ' '`" #ex: 1200 800
fi
IMAGEHORIZ=`echo -n "$IMAGEDIMS" | cut -f 1 -d ' '`
IMAGEVERT=`echo -n "$IMAGEDIMS" | cut -f 2 -d ' '`

ROOTDIMS="`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' '`"
ROOTHORIZ=`echo -n "$ROOTDIMS" | cut -f 1 -d ' '`
ROOTVERT=`echo -n "$ROOTDIMS" | cut -f 2 -d ' '`

#v423...
RATIOIMAGE=`dc $IMAGEHORIZ $IMAGEVERT div 100 mul p | cut -f 1 -d '.'`
RATIOROOT=`dc $ROOTHORIZ $ROOTVERT div 100 mul p | cut -f 1 -d '.'`
#echo "RATIOIMAGE=$RATIOIMAGE RATIOROOT=$RATIOROOT" #TEST
xRATIOIMAGE=`expr $RATIOIMAGE + 5` #allow for roundoff errors.
[ $xRATIOIMAGE -ge $RATIOROOT ] && exit

#v423 some math gymnastics involved here...
IMGVERTSCALED=`dc $ROOTHORIZ $IMAGEHORIZ div $IMAGEVERT mul p`
VERTDIFF=`dc $IMGVERTSCALED $ROOTVERT sub p`
NEWIMGVERTSCALED=`dc $IMGVERTSCALED $VERTDIFF sub p`
NEWVERT=`dc $IMAGEHORIZ $ROOTHORIZ div $NEWIMGVERTSCALED mul p | cut -f 1 -d '.'` #v424 fix.

#echo "IMGVERTSCALED=$IMGVERTSCALED VERTDIFF=$VERTDIFF NEWIMGVERTSCALED=$NEWIMGVERTSCALED NEWVERT=$NEWVERT" #TEST

#this method only cuts off the bottom of image...
#if [ $xNEWVERT -lt $IMAGEVERT ];then
# jpegtopnm ${IMAGEFILE} | pamdice -height=${NEWVERT} -outstem=/root/out #creates out_0_0.ppm
# [ $? -ne 0 ] && exit
# pnmtojpeg -quality=85 out_0_0.ppm > ${IMAGEFILE}
# rm -f /root/out_*.ppm
#fi

#this method cuts equal amount from top and bottom...
if [ $NEWVERT -lt $IMAGEVERT ];then #precaution
 PAMCUT="pamcut"
 [ "`which pnmcut`" != "" ] && PAMCUT="pnmcut" #older netpbm.
 CUTVERT=`expr $IMAGEVERT - $NEWVERT`
 TOP=`expr $CUTVERT \/ 2`
 BOTTOM=`expr $NEWVERT + $TOP`
# jpegtopnm ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} | ${PAMCUT} -left=0 -right=${IMAGEHORIZ} -top=${TOP} -bottom=${BOTTOM} | pnmtojpeg -quality=85 > ${IMAGEFILE}
 if [ "$IMAGEEXT" = "jpg" ];then
  jpegtopnm ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} | ${PAMCUT} -left=0 -top=${TOP} -bottom=${BOTTOM} | pnmtojpeg -quality=85 > ${IMAGEFILE}
 else
  pngtopnm ${IMAGEPATH}_original/ORIGINAL-${IMAGEBASE} | ${PAMCUT} -left=0 -top=${TOP} -bottom=${BOTTOM} | pnmtopng > ${IMAGEFILE}
 fi
fi

###END###
/usr/sbin/background_reshape

Christian.. is it not the same in Wary?

As a test

Get a png in root and make sure it is 4*3 aspect, or close enough. Then run
Code:
background_reshape nameofpic.png
What happens?
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 26 Mar 2013, 22:26    Post subject:  

No problems with Wallpaper 0.6.2 in good old dpup 485... which uses a iso locale, iso-8859-1.
Vv-ee-rr-yy strange...
works-fine-in-dpup-485(iso-8859-1).jpg
 Description   
 Filesize   47.02 KB
 Viewed   521 Time(s)

works-fine-in-dpup-485(iso-8859-1).jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 26 Mar 2013, 22:53    Post subject:  

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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 26 Mar 2013, 23:23    Post subject:  

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!
Wallpaper-0.6.1-1-sp.snp2.tar.bz2
Description  more robust now. was having issues if configuration files in /root/.config/rox*/wallpaper did not match
bz2

 Download 
Filename  Wallpaper-0.6.1-1-sp.snp2.tar.bz2 
Filesize  11.61 KB 
Downloaded  280 Time(s) 
background_reshape.bz2
Description  for the records only. wjaguar did it much more professional.
bz2

 Download 
Filename  background_reshape.bz2 
Filesize  2.31 KB 
Downloaded  270 Time(s) 

Last edited by Karl Godt on Wed 27 Mar 2013, 21:05; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Wed 27 Mar 2013, 00:34    Post subject:  

Karl,

Please hack on this version of Nathan wallpaper <<--
http://ftp.aarnet.edu.au/pub/puppylinux/pet_packages-slacko14/wallpaper-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?

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Wed 27 Mar 2013, 03:35    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Wed 27 Mar 2013, 05:03    Post subject:  

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:
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.
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Wed 27 Mar 2013, 05:54    Post subject:  

Nope, it is something with
Code:
pngtopnm "${IMAGEPATH}"_original/ORIGINAL-"${IMAGEBASE}" | ${PAMCUT} -left=0 -top=${TOP} -bottom=${BOTTOM} | pnmtopng > "${IMAGEFILE}"

:LOL:
garbledscreen.jpg
 Description   
 Filesize   55.97 KB
 Viewed   469 Time(s)

garbledscreen.jpg

Back to top
View user's profile Send private message Visit poster's website 
wjaguar

Joined: 21 Jun 2006
Posts: 266

PostPosted: Wed 27 Mar 2013, 08:30    Post subject:  

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. Smile

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.
background_reshape.gz
Description 
gz

 Download 
Filename  background_reshape.gz 
Filesize  1.65 KB 
Downloaded  296 Time(s) 
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Wed 27 Mar 2013, 12:01    Post subject:  

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. (Smile 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.
Nature-sauvage-Qc-1152x864_backdrop.jpg
 Description   
 Filesize   40 KB
 Viewed   473 Time(s)

Nature-sauvage-Qc-1152x864_backdrop.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Sat 30 Mar 2013, 03:42; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Wed 27 Mar 2013, 13:22    Post subject:  

Thanks to you wjaguar and Karl_Godt, problem solved ! Smile

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

Again, many thanks! You guys made my day! Very Happy

Best.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Wed 27 Mar 2013, 15:17    Post subject:  

wjaguar, your's showing the hand of a professional ! Many thanks !
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 3 [33 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
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.1699s ][ Queries: 13 (0.0053s) ][ GZIP on ]