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-17-2020, 12:51 PM   #1
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
fbink image scaling question

Hi NiLuJe,
So I am printing small images using fbink, and they seem to be getting scaled in a manner I don't understand. For example:
fbink -i pic1.png -g halign=CENTER,w=775,y=690 -q'

No matter how small I make (pixel dimensions) the .png file, it seems to print at the same large size. w value remains unchanged What am I missing?

Thanks for the help!
handyguy is offline   Reply With Quote
Old 12-17-2020, 01:22 PM   #2
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,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Because setting w *requests* scaling (it stands for width ^^).

Since I see an y flag right after, perhaps you meant to be using x here instead?

(When in doubt, enable verbose mode, it'll spout a *lot* of crap about what's happening and why ^^).
NiLuJe is offline   Reply With Quote
Advert
Old 12-17-2020, 02:30 PM   #3
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
ahhh - so w is not a scaling factor, it is an absolute width in pixels? Is there a scaling factor option in fbink, or a scaling factor in vertical pixels?

Last edited by handyguy; 12-17-2020 at 04:37 PM.
handyguy is offline   Reply With Quote
Old 12-17-2020, 04:56 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,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The only thing that works with a plain factor is the fixed cell font rendering.

For images, scaling indeed works as "get me a wxh image out of whatever I'm feeding you". (Or a best fit for w; a best fit for h; a best fit for screen; there's a few magic values/combinations to achieve that, but the default is to keep the AR).

The assumption being that you know the screen size, you know the specific area you want to fill, so you don't really care about the source's size.

----

That said, it's entirely possible to request the image's dimensions without fully decoding it (for... most image formats, anyway), but that's not something that's currently exposed, even to API users.

I might revisit that later when I try my hands at a NanoSVG frontend, because knowing the optimal raster size for those *does* make sense, but it's highly unlikely to end up being exposed to the CLI tool, only to API users.

Last edited by NiLuJe; 12-17-2020 at 04:59 PM.
NiLuJe is offline   Reply With Quote
Old 12-17-2020, 05:03 PM   #5
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,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
When in doubt, read the giant wall of text that stands as documentation for the CLI-tool ^^. Here, specifically this section.

(I keep forgetting to add a real --help flag, mainly because the short -h is already taken for invert for... non-obvious reasons unless you've ever used eips on Kindle ;p. But it's currently displayed when no arguments are specified).

Or, the slightly less daunting and much better organized wall of text inlined in the API doc.
NiLuJe is offline   Reply With Quote
Advert
Old 12-17-2020, 05:05 PM   #6
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,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Sidebar: it's not nearest neighbor scaling (it's Qt's smooth scaling algo), so choosing a "perfect" scaling factor won't help you much, FWIW .
NiLuJe is offline   Reply With Quote
Old 12-17-2020, 07:01 PM   #7
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
I should read the documentation once in awhile! Actually, I have copied the full fbink help text to a flat file for review purposes. I have changed the w parameter to h, and it does exactly what I want - any image displayed exactly at a specific height.
Thanks!

Last edited by handyguy; 12-18-2020 at 01:26 AM.
handyguy is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[ENHANCEMENT] Reducing book size through image scaling xdgc Development 5 08-06-2019 11:46 PM
Image scaling best-practices Notjohn Kindle Formats 57 12-02-2018 03:38 PM
image scaling problems: due to PNG format stumped ePub 23 03-06-2017 05:30 AM
Scaling up an image via SVG Kayto ePub 27 01-26-2013 03:38 AM
Calibre News Epub Image Scaling grib Calibre 3 01-07-2010 06:45 AM


All times are GMT -4. The time now is 10:41 AM.


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