https://bugs.kde.org/show_bug.cgi?id=60272
teknopaul changed:
What|Removed |Added
CC||teknop...@gmail.com
--- Comment #16 from teknopaul ---
Anyone finding this , the following script converts a .k3b saved MP3 CD image
file to an Inkscape compatible .svg file for printing. A bit of SVG hacking is
required to tune the output.
You might want to fiddle the image size, I print smaller than CD size for
insert slips in a CD case.
Also might provide some hints for how to easily implement this feature in K3B.
Save as k3btosvg.sh in a ~/bin directory.
#!/bin/bash -e
#
# Create an Inkscape SVG file from a K3B saved disk.
#
# K3B saved disk format is a zipped XML file with a list of the files
# including, thankfully, the expanded title an author from a MP3 files.
#
# Bit hacky, potentially breaks if the K3B XML writing code changes.
#
SRC="$1"
if [ "$SRC" == "" ] ; then
echo "Usage: $0 [k3b filename]"
exit 1
fi
#
# cd to the file's directory first
#
cd $(dirname "$SRC")
#
# Make a temp dir extract the k3b file.
#
mkdir .tmp
cp "$SRC" ".tmp/$SRC.out"
cd .tmp
unzip "$SRC.out" >/dev/null
#
# Extract the file title and artist from the XML.
#
cat maindata.xml | egrep 'title|artist' | sed ':a;N;$!ba;s/\n/ /g' | sed
's/<\/artist>/<\/flowPara>\n/g' > maindata.txt
sed -i 's///g' maindata.txt
sed -i 's/<\/title>/ - /g' maindata.txt
sed -i 's///g' maindata.txt
#
# Show the user what we found
#
cat maindata.txt
#
# Create ain inkscape compatible CD cover file.
#
echo '
http://www.w3.org/2000/svg;
width="343pt"
height="340pt"
version="1.1">
' > "../$SRC.svg"
cat maindata.txt >> "../$SRC.svg"
echo '
' >> "../$SRC.svg"
#
# Open inkscape
#
inkscape "../$SRC.svg" &
#
# Clean up the extracted files
#
cd ..
rm .tmp/*
rmdir .tmp
--
You are receiving this mail because:
You are watching all bug changes.