11-22-2018, 09:18 PM
Okay, this is how far I've got.
The syntax for the {image} directive has a new argument 'id=XXX' that specifies a known asset identified by the id 'XXX'. 'XXX' may be an arbitrary identifier.
For the {image} directive, the asset should be an image.
How the relation from 'XXX' to the image is established is up to the application program.
One way to define an asset is with a special file comment (not to be mistaken with a ChordPro {comment}). Such a comment looks like:
Minimal, or with all options:
which is immedeately followed by the data for the image, base64 encoded, in lines that start with "# " (pound space).
So when the user presents a ChordPro file with one or more {image}s, Companion can change the {image} directives and include the image data as shown above. For people that do not use Companion, there are other tools that can assist.
When a song is edited in MSPro, the asset data can be omitted to not clobber the view and/or slow down the editor.
What do you think?
The syntax for the {image} directive has a new argument 'id=XXX' that specifies a known asset identified by the id 'XXX'. 'XXX' may be an arbitrary identifier.
For the {image} directive, the asset should be an image.
How the relation from 'XXX' to the image is established is up to the application program.
One way to define an asset is with a special file comment (not to be mistaken with a ChordPro {comment}). Such a comment looks like:
Code:
##image: id=XXX
Minimal, or with all options:
Code:
##image: id=XXX src=im.png type=png width=1341 height=340 enc=base64
which is immedeately followed by the data for the image, base64 encoded, in lines that start with "# " (pound space).
Code:
# iVBORw0KGgoAAAANSUhEUgAABT0AAAFUCAIAAABp2w/aAAAABGdBTUEAALGPC/xhBQAAAER0RVh0
# U29mdHdhcmUAWFYgdmVyc2lvbiAzLjEwYS1qdW1ib0ZpeCtFbmggb2YgMjAwODEyMTYgKGludGVy
... many more ...
# AAd0SU1FB+AEBwgjAAJ9CYIAAAAedEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1QCpgy
# LukAAAAASUVORK5CYII=
So when the user presents a ChordPro file with one or more {image}s, Companion can change the {image} directives and include the image data as shown above. For people that do not use Companion, there are other tools that can assist.
When a song is edited in MSPro, the asset data can be omitted to not clobber the view and/or slow down the editor.
What do you think?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).