|
Post by vovchik on Oct 19, 2018 22:03:42 GMT 1
Dear all, Here are a few BaCon svgs that we might want to use in our own programs. Just unpack the archive. With kind regards, vovchik Attachments:bacon-svg.tar.gz (21.52 KB)
|
|
|
Post by alexfish on Oct 20, 2018 9:26:25 GMT 1
Hi Vovchik not sure about the bacon eyes svgs this what shows on the RPI ADDED not sure what is happening if open the file with Chromium then the quotes are different IE Chromium shows <svg width="256" height="256" viewBox="0 0 64 64"> <ellipse cx="32" cy="22" rx="6" ry="8" fill="white" stroke="none"/> <ellipse cx="50" cy="20" rx="6" ry="8" fill="white" stroke="none"/> and gtk source view shows <svg width='256' height='256' viewBox='0 0 64 64'> <ellipse cx='32' cy='22' rx='6' ry='8' fill='white' stroke='none'/> <ellipse cx='50' cy='20' rx='6' ry='8' fill='white' stroke='none'/> BR Alex Attachments:
|
|
|
Post by vovchik on Oct 20, 2018 12:12:26 GMT 1
Dear Alex,
Thanks for noting that. I looked at them in gpicview on PI and see the same distorted thing. Weird. They show perfectly normally on Mint 18.3. ksvgtopng does render a proper png from those two on PI, but rsvg-view-3 shows a mess. It is likely a bug in rsvg on the PI. I wonder whether anybody has fixed it.
With kind regards, vovchik
|
|
|
Post by alexfish on Oct 20, 2018 12:22:42 GMT 1
Hi Vovchik have managed to get Chromium & Epiphany to show the files . picview still shows a mess two updated files for testing. BR Alex
|
|
|
Post by vovchik on Oct 20, 2018 13:12:05 GMT 1
Dear Alex,
Thanks. I did a diff and see that you modded the top bit:
<?xml version='1.0' encoding='UTF-8'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='256' height='256' viewBox='0 0 64 64'>
I wonder why gpicview still has problems. And the other svtgs work without the header info. Weird.
With kind regards, vovchik
|
|
|
Post by alexfish on Oct 20, 2018 15:21:59 GMT 1
Hi Vovchik
Think these contain linked numerical errors
IE
this bit shows ok
<?xml version='1.0' encoding='UTF-8'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='256' height='256' viewBox='0 0 64 64'> <ellipse cx='32' cy='22' rx='6' ry='8' fill='blue' stroke='none'/> <ellipse cx='50' cy='20' rx='6' ry='8' fill='blue' stroke='none'/> <path d='M38.8 62.79 c6.94 -0.9 9.43 -1.77 12.16 -4.3 4.81 -4.47 6.7 -12.93 3.88 -17.33 -1.46 -2.26 -1.47 -2.56, -0.16 -5.66 0.96 -2.27 1.2 -3.9 2.13 -14.34 0.37 -4.15 -0.23 -5.75 z ' fill='#e9d290'/> </svg>
and this does not work
<?xml version='1.0' encoding='UTF-8'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='256' height='256' viewBox='0 0 64 64'> <ellipse cx='32' cy='22' rx='6' ry='8' fill='white' stroke='none'/> <ellipse cx='50' cy='20' rx='6' ry='8' fill='white' stroke='none'/> <path d='M38.8 62.79c6.94-.9 9.43-1.77 12.16-4.3 4.81-4.47 6.7-12.93 3.88-17.33-1.46-2.26-1.47-2.56-.16-5.66.96-2.27 1.2-3.9 2.13-14.34.37-4.15-.23-5.75-4.04-10.7-4.45-5.8 -8.24-8.1-14.83-9.05-6.13-.87-15.96.8-21.18 3.6-2.5 1.35-7.47 7.17-8.07 9.45-.28 1.05-.5 3.38-.5 5.19 0 6.08 2.6 z' fill='#e9d290'/>
</svg>
to highlight bottom line with these bits
3.6-2.5 1.35-7.47 7.17-8.07 should be like 3.6 -2.5 1.35 -7.47 7.17 -8.07 and if <1 IE -.9 should be -0.9 or .9 should be 0.9
BR Alex
|
|
|
Post by vovchik on Oct 20, 2018 18:42:43 GMT 1
Dear Alex, I fiddled with the svgs and rounded. These now show up OK on Mint and PI. With kind regards, vovchik Attachments:bacon-rnd1.svg.tar.gz (6.04 KB)
|
|
|
Post by alexfish on Oct 20, 2018 20:12:42 GMT 1
Hi Vovchik
all working and 'gm convert' as well
to all 'if using a web-view to view the image' change the header to notify utf8 and xlink
IE
<?xml version='1.0' encoding='UTF-8'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='256' height='256' viewBox='0 0 64 64' preserveAspectRatio='none'> many thanks + BR Alex
|
|
|
Post by vovchik on Oct 20, 2018 21:00:35 GMT 1
Dear Alex,
I updated the archive in the first post with working baconeyes (and all svgs now with full headers).
With kind regards, vovchik
|
|
|
Post by alexfish on Oct 28, 2018 10:34:07 GMT 1
Hi Vovchik
Thanks for the update
Pi picview Renders all
BR Alex
|
|
|
Post by bigbass on Oct 28, 2018 16:41:06 GMT 1
Hello Guys Glad you got the pi related problem sorted out Thanks for the scalable svgs I used all your images and just converted them to standardised icons so we have can use them in themes too ICONS.tar.gz (171.63 KB) P.S I was working with my cousin he is making a cnc router I helped with the software problems that he had and stepper motor code part using the universal gcode sender its working with an arduino now but we are going to convert it to use the raspberry pi3 for the next step (stay tuned still in the prototype stage) and in the source code I found a script svg2icon And I used that to convert all you images made some adjustments for the pi #!/bin/bash
# example usage #./svg_to_icons.sh /home/pi/Downloads/bacon-svg
# ./scripts/svg_to_icons.sh ./ugs-platform/ugs-platform-ugscore/src/main/resources/resources/icons
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then echo "Usage: $0 DIRECTORY" >&2 exit 1 fi
cd "$( realpath "$1" )"
#if [ -f /Applications/Inkscape.app/Contents/Resources/bin/inkscape ]; then #alias inkscape="/Applications/Inkscape.app/Contents/Resources/bin/inkscape"
#raspberry pi fix by bigbass if [ -f `which inkscape` ]; then alias inkscape="/usr/bin/inkscape"
else echo "Inkscape not found" exit 1 fi
TRUE_BLACK="#000000" BLACKISH="#353a40" ALWAYS_BLACK="#010101" LIGHT_BLUE="#0ac9f1" DARK_BLUE="#41818f"
# Make sure nobody is using black instead of blackish for INPUT in *.svg ; do sed -e "s/$TRUE_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/temp" mv "${PWD}/temp" "${PWD}/${INPUT}" done
# Generate _dark and _disabled_dark vectors for INPUT in *.svg ; do FILENAME=${INPUT%.*} sed -e "s/$BLACKISH/$LIGHT_BLUE/g" -e "s/$ALWAYS_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/${FILENAME}_dark.svg" sed -e "s/$BLACKISH/$DARK_BLUE/g" -e "s/$ALWAYS_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/${FILENAME}_disabled_dark.svg" done
# Generate png files in various sizes for INPUT in *.svg ; do FILENAME=${INPUT%.*} SUFFIX=".png" if [[ ${FILENAME} = *"disabled_dark" ]]; then FILENAME="${FILENAME/_disabled_dark/}" SUFFIX="_disabled_dark.png" elif [[ ${FILENAME} = *"_dark" ]]; then FILENAME="${FILENAME/_dark/}" SUFFIX="_dark.png" fi #inkscape --export-area-page --file "${PWD}/${INPUT}" -w 16 -h 16 --export-png "${PWD}/${FILENAME}${SUFFIX}" # fixed problem with the naming for 16x16 bigbass inkscape --export-area-page --file "${PWD}/${INPUT}" -w 16 -h 16 --export-png "${PWD}/${FILENAME}16${SUFFIX}" inkscape --export-area-page --file "${PWD}/${INPUT}" -w 24 -h 24 --export-png "${PWD}/${FILENAME}24${SUFFIX}" inkscape --export-area-page --file "${PWD}/${INPUT}" -w 32 -h 32 --export-png "${PWD}/${FILENAME}32${SUFFIX}" # added 48 for raspberry pi inkscape --export-area-page --file "${PWD}/${INPUT}" -w 48 -h 48 --export-png "${PWD}/${FILENAME}48${SUFFIX}" done
# added cleanup script for raspberry pi below by bigbass # everything gets moved into a the folder ICON # then we make folders for each size # this way follows closer to the icon standard
mkdir -p ./ICONS
mkdir -p ./ICONS/16x16 mkdir -p ./ICONS/24x24 mkdir -p ./ICONS/32x32 mkdir -p ./ICONS/48x48
mv *48*.png ./ICONS/48x48 mv *32*.png ./ICONS/32x32 mv *24*.png ./ICONS/24x24 mv *16*.png ./ICONS/16x16
|
|
|
Post by vovchik on Oct 28, 2018 18:29:44 GMT 1
Dear Joe,
Thanks. I generally avoid inkscape because it is big, slow and, if saving svgs, tends, by default, to blow up svgs unnecessarily (e.g. useless sodipodi and inkscape xml nodes and vars, silly precision). What does the conversion job efficiently and properly is tiny rsvg-convert. Give it a try. I use it all the time for png conversions. It runs fine on my PI, too.
With kind regards, vovchik
|
|
|
Post by bigbass on Oct 29, 2018 6:19:53 GMT 1
Hello vovchik I agree inkscape is very heavy so a big thanks for your suggestion so I installed the apt-get install librsvg2-bin which has the rsvg-convert .... inside a bit tricky to solve that changed the script for rsvg-convert #!/bin/bash
# example usage #./svg_to_icons.sh /home/pi/Downloads/bacon-svg
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then echo "Usage: $0 DIRECTORY" >&2 exit 1 fi
cd "$( realpath "$1" )"
#raspberry pi fix by bigbass thanks vovchik for the idea to use rsvg-convert instead of default inkscape if [ -f `which rsvg-convert` ]; then alias rsvg-convert="/usr/bin/rsvg-convert"
else echo "rsvg-convert" echo " apt-get install librsvg2-bin" exit 1 fi
TRUE_BLACK="#000000" BLACKISH="#353a40" ALWAYS_BLACK="#010101" LIGHT_BLUE="#0ac9f1" DARK_BLUE="#41818f"
# Make sure nobody is using black instead of blackish for INPUT in *.svg ; do sed -e "s/$TRUE_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/temp" mv "${PWD}/temp" "${PWD}/${INPUT}" done
# Generate _dark and _disabled_dark vectors for INPUT in *.svg ; do FILENAME=${INPUT%.*} sed -e "s/$BLACKISH/$LIGHT_BLUE/g" -e "s/$ALWAYS_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/${FILENAME}_dark.svg" sed -e "s/$BLACKISH/$DARK_BLUE/g" -e "s/$ALWAYS_BLACK/$BLACKISH/g" "${PWD}/${INPUT}" > "${PWD}/${FILENAME}_disabled_dark.svg" done
# Generate png files in various sizes for INPUT in *.svg ; do FILENAME=${INPUT%.*} SUFFIX=".png" if [[ ${FILENAME} = *"disabled_dark" ]]; then FILENAME="${FILENAME/_disabled_dark/}" SUFFIX="_disabled_dark.png" elif [[ ${FILENAME} = *"_dark" ]]; then FILENAME="${FILENAME/_dark/}" SUFFIX="_dark.png" fi
# fixed problem with the naming for 16x16 bigbass switched to rsvg-convert # modded code for rsvg-convert rsvg-convert "${PWD}/${INPUT}" -w 16 -h 16 -o "${PWD}/${FILENAME}16${SUFFIX}" rsvg-convert "${PWD}/${INPUT}" -w 24 -h 24 -o "${PWD}/${FILENAME}24${SUFFIX}" rsvg-convert "${PWD}/${INPUT}" -w 32 -h 32 -o "${PWD}/${FILENAME}32${SUFFIX}" # added 48 for raspberry pi rsvg-convert "${PWD}/${INPUT}" -w 48 -h 48 -o "${PWD}/${FILENAME}48${SUFFIX}" done
# added cleanup script for raspberry pi below by bigbass # everything gets moved into a the folder ICON # then we make folders for each size # this way follows closer to the icon standard
mkdir -p ./ICONS
mkdir -p ./ICONS/16x16 mkdir -p ./ICONS/24x24 mkdir -p ./ICONS/32x32 mkdir -p ./ICONS/48x48
mv *48*.png ./ICONS/48x48 mv *32*.png ./ICONS/32x32 mv *24*.png ./ICONS/24x24 mv *16*.png ./ICONS/16x16 rm *_dark.svg
|
|
|
Post by vovchik on Oct 29, 2018 10:07:46 GMT 1
Dear Joe, Thanks for the updated script. It works perfectly. And it is fast. Rsvg-convert is a nice little utility, too, and weighs in at about 14k on PI. Inkscape isn't yet on my PI but, on an Intel machine, it is about 14 MB, so using rsvg-convert is probably the better way to go. With kind regards, vovchik
|
|
|
Post by alexfish on Oct 31, 2018 19:27:32 GMT 1
Hi vovchik
have tested Dia & |GM convert V rsvg-convert
at present can see that the rsvg-convert is still in poll position.
now going to see if it can convert image links ,image link work with rsvg-view-3. where as Pixbuf & librsvg to buffer fail
the link has been removed from librsvg , so I am not sure how rsvg-view3 gets around it.
BR Alex
|
|