04-01-2024, 06:54 AM | #1 |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
Workarounds to displaying an SVG image?
Hi, I'm trying to display an SVG image using FBink but its not part of the features. I'm looking for a workaround to it but haven't been able to find anything that works by running python on my Kobo Aura. Any ideas of an already existing workaround to get this working in fbink?
I was thinking maybe converting the SVG to another format, but after trying a few recommendations i found online (e.g. cairo) they don't seem to work well on my kobo (while installing some, the reader would crash, or i would get an error that there isn't enough storage while downloading the necessary packages/libraries) |
04-01-2024, 01:38 PM | #2 |
Bibliophagist
Posts: 38,193
Karma: 152037714
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If they are fixed images, can you convert them before sending to your Kobo? Assuming you are not downloading the images directly to your Kobo.
|
Advert | |
|
04-01-2024, 06:46 PM | #3 |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
ah, forgot to mention that I am generating these inside my Kobo through a python script. I'm using a script that collects weather data and replaces some text on a preexisting SVG image with the weather info, but them i am struggling to display this on my kobo.
|
04-02-2024, 09:33 AM | #4 |
Connoisseur
Posts: 88
Karma: 3892
Join Date: Feb 2022
Device: Kobo nia
|
python can't convert images via a simple library? rust can do that, even chatgpt will tell you such a program then simply compile it using cross
|
04-03-2024, 05:16 PM | #5 | |
Wizard
Posts: 2,784
Karma: 6990707
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Quote:
Alternatively, with a bit of code, it should be possible to make some nice bindings between FBInk and resvg. |
|
Advert | |
|
04-03-2024, 07:04 PM | #6 | |
Enthusiast
Posts: 29
Karma: 20342
Join Date: Jul 2023
Device: Kobo Glo, Kobo Sage
|
Quote:
Spoiler:
If you don't have any experience with Rust I could try creating a binary that'll display the SVG if you attach an example file that's been processed by your Python script. |
|
04-03-2024, 08:40 PM | #7 | |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
Quote:
Attached is an example SVG I'm getting as output. As mentioned, easiest thing would be to be able to get FBink to display it as is, or t convert it to png or another format supported by FBink. I have been able to create this SVG both on my computer, and by running a Python script on my Kobo Aura. This is the source script https://github.com/mattzzw/kindle-we...weather2svg.py |
|
04-03-2024, 11:34 PM | #8 |
Enthusiast
Posts: 29
Karma: 20342
Join Date: Jul 2023
Device: Kobo Glo, Kobo Sage
|
Try the binary I've attached. It works on my Glo with your example file. You'll need to provide the path to the SVG file as the first argument when you call it from the python script.
|
04-04-2024, 09:28 AM | #9 |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
Thanks for this. Will test it over the weekend and report back!
|
04-21-2024, 02:52 AM | #10 | |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
Quote:
Quick question re your binary. Does it support other fbink commands/options? I tried displaying the image using some parameters that work for mewith fbink, but they don't seemt to be recognised here: fbink -c -f -i weather-script-output.png -g w=-1,h=-1 works ok, but neither of these other 2 seem to work fbink-svg -c -f -i weather-script-output.svg -g w=-1,h=-1 or fbink-svg weather-script-output.svg -c -f -i -g w=-1,h=-1 I need those extra parameters to force a complete refresh of the screen. I haveone of those screens that are VERY prone to ghosting effects, so I need a full refresh to be able toproperly see the image. The workaround i'm using now is displaying a blank png using fbink and the desired parameters, and then using your binary to display the SVG. Last edited by gonzule; 04-21-2024 at 06:44 AM. |
|
04-22-2024, 09:45 PM | #11 | ||
Enthusiast
Posts: 29
Karma: 20342
Join Date: Jul 2023
Device: Kobo Glo, Kobo Sage
|
Quote:
Quote:
fbink-svg weather-script-output.svg or fbink-svg weather-script-output.svg /path/to/fonts Here's the code, FWIW: Spoiler:
|
||
04-26-2024, 08:15 PM | #12 |
before sleep, read or TV?
Posts: 104
Karma: 10
Join Date: Apr 2008
Location: Australia
Device: Kobo Libra 2
|
Thanks again! This worked like a charm! I'll work now using kfmon to launch the script to generate the svg and then displaying it using your binary and should be all set! Thank you for taking the time to coding this
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Displaying SVG | jiembe | Editor | 4 | 05-14-2021 07:43 AM |
svg image on top of a background png image | roger64 | ePub | 25 | 04-24-2015 11:00 AM |
Display of a png image linked to a svg image | roger64 | Editor | 6 | 03-13-2015 06:21 AM |
SVG Images on iPad - contained bitmap image not displaying | heulwen.jones | ePub | 5 | 04-07-2014 12:42 AM |
Help displaying SVG notes. | mastroalex | Sony Reader Dev Corner | 2 | 09-30-2011 05:16 AM |