![]() |
#1 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
|
Trouble displaying image with eips
I threw together a standalone binary that renders the weather to a jpg and calls eips to display it. I'm having issues with the Kindle displaying the image. Any help figuring out how to make it behave would be really great.
This should show the problem where the kindle is stretching the image: https://imgur.com/a/Jrfmm The app source is here: https://github.com/DDRBoxman/kindle-weather Also is there a way to prevent the system from redrawing the status bar? |
![]() |
![]() |
![]() |
#2 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
What kindle model? What version of firmware? eips has different capabilities and different parameters across the product line. Even the parameters have changed over time for similar functions, and not all versions support images.
For example, some image support is handled with raw framebuffer images in update scripts, even though the eips command claims to support png images (which did not work for me, and apparently not for lab126 either). These commands were not designed for our direct use. In general, eips has always worked for text, though with its limited character set. If you want your app to run on multiple kindle models, you need it to adapt to what is available or provide your own image display utility. You can use eips to trigger framebuffer updates, but even that is not consistent or reliable on all models. This is why terminal programs (like Matan's) render their own text characters to the framebuffer. However, the only (native mode) program I have seen so far works consistently across the entire product line in all firmwares and modes (including main and diags) is my kindle video player, and that is my base for the menu/terminal program I am working on now (because needed for K1 and Oasis). Last edited by geekmaster; 07-12-2016 at 11:46 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
|
It's a Kindle touch (K5)
On firmware 5.3.7.3 |
![]() |
![]() |
![]() |
#4 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
With ssh, you can ask eips for help "eips -h" thought the level of detail various across versions (and the image display parameter changes as well, either -b or -g, and what image formats it supports changes). Good luck. I just use raw framebuffer images myself. For 8-bit grayscale framebuffer support, be sure that the lower and upper 4-bits are identical (and use dithering for additional shades of gray).
|
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
|
Great job! I had the same idea but no time to execute. Depending on your desired battery usage it may be nice to enable WLAN only temporarily to fetch the NOAA data.
eips may be able to display also PNG images. Could you also attach your weather.png and weather.jpg images? So one could simply simply "eips -g weather.png" without cross compiling and installing the code. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@DDRBoxman: eips -f -g handles PNG8 just fine
![]() You do have to make sure they're reaaaal PNG8, and not indexed, but apart from that, it works. Can't remember if there's a way to make it behave with JPGs. See this post and its two links for the one-liner I use with ImageMagick to process stuff that will work through both eips and the framework's usage of libpng. EDIT: As for reining in the menu, look at KOReader's startup script for all the various ways to achieve that depending on the device & FW combo. A TL;DR version that may not be too invasive: sigstop whatever's handling the screen updates (i.e;, cvm on legacy devices, awesome otherwise). Last edited by NiLuJe; 07-13-2016 at 06:52 AM. |
![]() |
![]() |
![]() |
#7 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
On the K1, it is 'eips -b', but for some reason it does not work with the framework shut down (hence raw usage from startup scripts). Though eips -h does show it is SUPPOSED to support PNG images, as I recall. I wonder why they did not backport eips "fixes" to newer versions of K1 firmware?
Last edited by geekmaster; 07-13-2016 at 07:07 AM. |
![]() |
![]() |
![]() |
#8 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@GM: Possibly because those "newer" FW were still released way earlier than the actual changes?
![]() |
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
|
I've attached a png that was generated and run through pngcrush.
It still has the same stretching issue from the initial post, I also changed to passing the -g and -f flags to eips. Guess I'll start looking into direct framebuffer access. |
![]() |
![]() |
![]() |
#10 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
The simplest thing to do is pure black and white where each byte contains 0 or 255, and that also avoids a full flash update (how gmplay does it). If you can display images but they are "squashed" try converting to 8-bit color (but 16-color color pallete 0x00 0x11 0x22 0x33 ... 0xff, with duplicate colors to extend it evenly to 256 colors). For an example examine the color histogram of screensaver images (where you will see 16 unique colors in a palette of 256 colors). To see how these pixels are packed, examine code in my "newtrix" demo (though its eink updates do not work on newer kindles). Last edited by geekmaster; 07-13-2016 at 09:42 PM. |
|
![]() |
![]() |
![]() |
#11 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
pngcrush will do evil things in the name of size optimization that'll definitely render it unusable for eips.
I did mention that eips was finicky, right? Don't try to outsmart it. |
![]() |
![]() |
![]() |
#12 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
|
You need to convert the png file to a 4-bit png file to use it directly with eips. The Kindle image viewer can display the file just fine but this does not help. I've seen no option to pass an argument to it to display an image without interaction.
https://groups.google.com/forum/#!to...ts/rSwXTj2r4J0 has an example to create 1-bit png file with Go, 4-bit shouldn't be much harder. I think we don't need compression locally, especially if you write it to memory (/tmp). |
![]() |
![]() |
![]() |
#13 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
|
Did you use 'pngcrush -bit_depth 4 ...'? This should produce a 4-bit PNG file.
|
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5
Karma: 2600
Join Date: Jul 2016
Device: Kindle Touch
|
Thanks for all the help everyone, I got it working. Just need to clean up the startup script that I copied from koreader and it should be good to go!
|
![]() |
![]() |
![]() |
#15 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
try touching two, diagonally opposite, screen corners at the same time, see if that gives you a screenshot.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Poster image on video not displaying on ipad | Apostrophe | Conversion | 0 | 06-18-2014 03:02 PM |
Displaying image on Kobo Aura HD | axellec | Kobo Developer's Corner | 13 | 01-11-2014 04:56 PM |
displaying first page or image without rule | fxp33 | Kobo Reader | 3 | 03-23-2013 08:11 PM |
Image not displaying | StephVincent | Kindle Formats | 0 | 08-22-2011 01:48 PM |
PRS-900 Having trouble displaying manga | shadowdragon986 | Sony Reader | 2 | 10-08-2010 11:31 AM |