Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-29-2015, 04:15 AM   #1
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
Kindle Touch-open specific image by command line

Hello,
I intend to control opening images stored on kindle touch (images folder) by one script.

With that need, i try to understand Kindle command to open specific images instead of manual action (tap on images). I see that running usr/bin/imageviewer.sh behaves like opening Images folder, then i have to tap on image to open it

Do you have any advice to do this or any similar packages to perform to open specific images? Appreciate for your help


P/S: i see kindle always returns following event when i touch/tap on images after running command udevadm monitor --property. Honestly, i do not understand and if we can utilize these information in making script to open specific image?

Code:
KERNEL[1451380348.330980] change   /devices/platform/zforce.0/input/input4 (input)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/platform/zforce.0/input/input4
SUBSYSTEM=input
ZForce=touch
PRODUCT=0/0/0/0
NAME="zforce"
PHYS="zforce/input0"
EV==b
KEY==6420 0 0 0 0 0 0 0 0 0 3
ABS==2608000 3
MODALIAS=input:b0000v0000p0000e0000-e0,1,3,k145,14A,14D,14E,ra0,1,2F,35,36,39,mlsfw
SEQNUM=1970

UDEV  [1451380348.332288] change   /devices/platform/zforce.0/input/input4 (input)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/platform/zforce.0/input/input4
SUBSYSTEM=input
ZForce=touch
PRODUCT=0/0/0/0
NAME="zforce"
PHYS="zforce/input0"
EV==b
KEY==6420 0 0 0 0 0 0 0 0 0 3
ABS==2608000 3
MODALIAS=input:b0000v0000p0000e0000-e0,1,3,k145,14A,14D,14E,ra0,1,2F,35,36,39,mlsfw
SEQNUM=1970

KERNEL[1451380348.432021] change   /devices/platform/zforce.0/input/input4 (input)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/platform/zforce.0/input/input4
SUBSYSTEM=input
ZForce=notouch
PRODUCT=0/0/0/0
NAME="zforce"
PHYS="zforce/input0"
EV==b
KEY==6420 0 0 0 0 0 0 0 0 0 3
ABS==2608000 3
MODALIAS=input:b0000v0000p0000e0000-e0,1,3,k145,14A,14D,14E,ra0,1,2F,35,36,39,mlsfw
SEQNUM=1971

UDEV  [1451380348.432332] change   /devices/platform/zforce.0/input/input4 (input)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/platform/zforce.0/input/input4
SUBSYSTEM=input
ZForce=notouch
PRODUCT=0/0/0/0
NAME="zforce"
PHYS="zforce/input0"
EV==b
KEY==6420 0 0 0 0 0 0 0 0 0 3
ABS==2608000 3
MODALIAS=input:b0000v0000p0000e0000-e0,1,3,k145,14A,14D,14E,ra0,1,2F,35,36,39,mlsfw
SEQNUM=1971

Last edited by eschwartz; 01-04-2016 at 03:46 AM. Reason: add code tags
thaonphuong is offline   Reply With Quote
Old 01-03-2016, 10:01 PM   #2
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
Finally, i see command eips can serve for my purpose

To load one image (600x800), i use
eips -g /path/to/image/file

To clear screen, use eips -c

Before that, i use lipc-set-prop com.lab126.powerd preventScreenSaver 1 to disable screen saver

This works on my kindle touch firmware 5.3.7.3
thaonphuong is offline   Reply With Quote
Advert
Old 01-04-2016, 03:57 AM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I think that is it.

I have seen other hacks that print images using eips, but I haven't seen anyone using the Kindle's native ImageViewer that way.

FWIW, use eips -f -g (for full update)
And you can save and restore whatever used to be on the screen by cat'ing to/from /dev/fb0 <--> temporary file.
eschwartz is offline   Reply With Quote
Old 01-09-2016, 06:28 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,485
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
For a real-world example of what @eschwartz just described, see the "Preview Current Screensaver" code in the ScreenSavers Hack's KUAL extension .
NiLuJe is online now   Reply With Quote
Old 01-10-2016, 12:48 AM   #5
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
Thanks eschwartz, combine option -f in when clear screen resolves my current issue. eips -f -c this reduce pattern/outline of previous image after being cleared

One thing i still have not finalize is the image format/property put on kindle screen. Is it 600 width * 800 height, grayscale ? I tried new image created from GIMP with mentioned info (600*800, grayscale) but it does not display at correct position (center) as i supposed. Any other image format i miss here?

An image- got from other kindle project (https://github.com/mpetroff/kindle-w...master/kindle/), which is displayed very fit on kindle.


Thanks
thaonphuong is offline   Reply With Quote
Advert
Old 01-10-2016, 02:23 AM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
600x800 images *should* display covering the entire screen perfectly.
It will expect a PNG.


What image are you using (upload it please, our "Go Advanced" reply mode comes with a free attachments feature) and what unexpected results are you getting?

Last edited by eschwartz; 01-10-2016 at 02:25 AM.
eschwartz is offline   Reply With Quote
Old 01-10-2016, 01:39 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,485
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
eips is *very* finicky. It expects a PNG8 with a 256c palette. Be careful when dithering down to 16c, since that (logically) tends to produce a 16c palette, which eips doesn't handle.

I usually use ImageMagick to handle that, the full commandline has been posted a few times around here (besides being in the ScreenSavers Hack) .
NiLuJe is online now   Reply With Quote
Old 01-11-2016, 08:46 AM   #8
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
Yes, my image is *.png. I attach my image here for reference

@NiLuJe, could you help forward the link, i search some but could not find. Sorry for this

Is below command correct convert filename.png -depth 8 converted_file.png?
thaonphuong is offline   Reply With Quote
Old 01-11-2016, 08:48 AM   #9
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
Oops, include attachment
Attached Thumbnails
Click image for larger version

Name:	file need to convert.png
Views:	293
Size:	698 Bytes
ID:	145429  
thaonphuong is offline   Reply With Quote
Old 01-11-2016, 10:38 AM   #10
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
File is not 600 w x 800 h
it is indexed two color
knc1 is offline   Reply With Quote
Old 01-11-2016, 12:06 PM   #11
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,485
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@thaonphuong: latest occurence. The palette also ships w/ the ScreenSavers hack.

Tweak the screen size as needed, of course (careful, it's specified two times, one for the image, and one for the letterboxing).
NiLuJe is online now   Reply With Quote
Old 01-12-2016, 03:46 AM   #12
thaonphuong
Member
thaonphuong began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2015
Device: EZReader
it displays very well on my kindle touch
convert in_filename.png -filter LanczosSharp -resize 300x400 -background white -gravity center -extent 600x800 -colorspace Gray -dither FloydSteinberg -quality 75 -define png:color-type=0 -define png:bit-depth=8 out_filename.png

Next step i will perform above command in batch, yeah. Many thanks NiLuJe for your help
thaonphuong is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange, specific bug rendering centered text w/ p class command in Nook touch ljcblue ePub 2 05-23-2014 12:43 PM
[Solved] Open Library Command-line tanstaafl1963 Library Management 2 01-05-2014 10:48 PM
Is there a way around the country specific restrictions for the Kindle Touch? tradingbr Kindle Developer's Corner 9 05-18-2012 12:07 AM
Kindle free book: Intelligence Was My Line: Inside Eisenhower's Other Command greencat Deals and Resources (No Self-Promotion or Affiliate Links) 0 06-15-2011 04:04 AM
Launching Kindle Previewer from command line? GRiker Kindle Developer's Corner 4 01-29-2011 08:00 PM


All times are GMT -4. The time now is 01:45 PM.


MobileRead.com is a privately owned, operated and funded community.