• ebook reader - image scaling ?

    From R.Wieser@21:1/5 to All on Thu May 30 11:02:08 2024
    Hello all,

    In a previous thread I mentioned I found the below ebook-reader :

    https://f-droid.org/en/packages/com.github.axet.bookreader/

    Currenly I've added an image (by hand) and am trying to get it to stretch to half a smartphones screen width. But no matter what I try (and which works
    in a HTML page on a PC(1) ) I can't find how to make that happen.

    (1) 'width=50%', 'width="50%"', 'style="width:50%;"' and using a CSS file.

    Question:
    Am I supposed to be able to resize images in an epub(2), and if so how is
    that done ?

    (2) the above epub reader does have "scale image(s) to fill the screen"
    option though, but thats not quite what I was after.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Thu May 30 08:02:48 2024
    On 5/30/2024 5:02 AM, R.Wieser wrote:
    Hello all,

    In a previous thread I mentioned I found the below ebook-reader :

    https://f-droid.org/en/packages/com.github.axet.bookreader/

    Currenly I've added an image (by hand) and am trying to get it to stretch to half a smartphones screen width. But no matter what I try (and which works in a HTML page on a PC(1) ) I can't find how to make that happen.

    (1) 'width=50%', 'width="50%"', 'style="width:50%;"' and using a CSS file.

    Question:
    Am I supposed to be able to resize images in an epub(2), and if so how is that done ?

    (2) the above epub reader does have "scale image(s) to fill the screen" option though, but thats not quite what I was after.


    You seem to have only half the story here. You're making
    your own epub file as HTML and CSS in a ZIP? I don't understand
    the syntax above.

    HTML: <IMG WIDTH=50% HEIGHT=50%> (it also works with quotes: "50%")
    Or <IMG STYLE="width: 50%; height: 50%;">
    Or in either a STYLE block or a CSS file: IMG {width: 50%; height: 50%;}

    And you can also use an ID:

    <STYLE>
    #Bigpic {width: 50%; height: 50%;}
    </STYLE>
    </HEAD>
    <BODY>

    <IMG ID="Bigpic">

    I don't know of anywhere you might use apostrophes other than
    inside javascript.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carlos E.R.@21:1/5 to R.Wieser on Thu May 30 14:59:36 2024
    On 2024-05-30 11:02, R.Wieser wrote:
    Hello all,

    In a previous thread I mentioned I found the below ebook-reader :

    https://f-droid.org/en/packages/com.github.axet.bookreader/

    Currenly I've added an image (by hand) and am trying to get it to stretch to half a smartphones screen width. But no matter what I try (and which works in a HTML page on a PC(1) ) I can't find how to make that happen.

    (1) 'width=50%', 'width="50%"', 'style="width:50%;"' and using a CSS file.

    Question:
    Am I supposed to be able to resize images in an epub(2), and if so how is that done ?

    (2) the above epub reader does have "scale image(s) to fill the screen" option though, but thats not quite what I was after.

    In my hardware ebook reader, images in epubs behave "weird". I have to
    double tap on the image (this switches to "image viewer mode"), and then
    I can zoom it. And sometimes I have to insist, not always it works.



    --
    Cheers, Carlos.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu May 30 15:57:06 2024
    Newyana2,


    You seem to have only half the story here. You're making
    your own epub file as HTML and CSS in a ZIP? I don't understand the syntax above.

    Ah, my apologies. I ment that I added an image to a page in an existing
    epub (and added a CSS file and updated the "content.opf").

    HTML: <IMG WIDTH=50% HEIGHT=50%> (it also works with quotes: "50%")
    Or <IMG STYLE="width: 50%; height: 50%;">
    Or in either a STYLE block or a CSS file: IMG {width: 50%; height: 50%;}

    Thats the thing - all that stuff that works in an HTML file doesn't seem to want to work in an EPUB. :-(

    (it also works with quotes: "50%")

    Make that "it *only* works with".

    And you can also use an ID:

    Or a class. Yes, I tried that too. I even tried to to put a "style="
    attribute into the image tag itself. Nothing worked.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Thu May 30 18:01:36 2024
    On 5/30/2024 9:57 AM, R.Wieser wrote:


    (it also works with quotes: "50%")

    Make that "it *only* works with".

    Officially attributes are supposed to be in quotes if non-numeric.
    Some people even put numbers in quotes. It works either way.
    I just tested it on IE and FF.

    And you can also use an ID:

    Or a class. Yes, I tried that too. I even tried to to put a "style=" attribute into the image tag itself. Nothing worked.

    Interesting. I've never dealt with an ebook reader.
    I guess it's not the same as basic HTML, even though
    it claims to be.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri May 31 10:07:55 2024
    Newyana2,

    (it also works with quotes: "50%")

    Make that "it *only* works with".

    Officially attributes are supposed to be in quotes if non-numeric.
    Some people even put numbers in quotes. It works either way.
    I just tested it on IE and FF.

    Yes, it does work on FF.

    But you overlooked one thing : my question was about *epub*, not a
    webbrowser. Any information about how it does work on something else is currently of little, if any, value to me.

    Interesting. I've never dealt with an ebook reader.
    I guess it's not the same as basic HTML, even though
    it claims to be.

    "basic HTML" ? Never heard of that.

    FYI, the html variant used in epub's is called XHTML (as I found yesterday). Its a bit more strict than the HTML implemented in webbrowsers. Including
    that *all* arguments to attributes need to be in double-quotes, regardless
    of if they are values or not.

    I found that out when I tried to make an image appear bigger using
    "width=100%" (no double-quotes around the "100%") causing he rest of the
    page to disappear. :-|


    As for the "its different" part ? There are two parts to that. One of them being that tried HTML in an app which expected XHTML, and the second part
    being that I have no idea if the epub-reader app I installed displays the
    ful range of allowed XHTML tags or just subset of them. For instance, I
    can't get a "<hr/>" to display.

    If you come across information which describes which XHTML tags an EPUB
    should display (and perhaps how) than to tell, as I could not find anything
    of the kind.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Fri May 31 08:40:31 2024
    On 5/31/2024 4:07 AM, R.Wieser wrote:

    "basic HTML" ? Never heard of that.

    HTML is official and defined. There are versions, but it's
    defined. Part of the original intention was to make it available
    and relatively easy to use. So interpreters are designed to make
    the best of what they get. If you make a syntax error in CSS
    then the whole thing wil fail from that point on. The parser just says
    "fuck this!" at the first irregularity. With HTML the browser will try
    to display as best it can.

    FYI, the html variant used in epub's is called XHTML (as I found yesterday). Its a bit more strict than the HTML implemented in webbrowsers. Including that *all* arguments to attributes need to be in double-quotes, regardless
    of if they are values or not.


    I wasn't familiar with XHTML. Wikipedia says it's actually a variant
    of XML rather than HTML. And there have been numerous versions.
    As near as I can tell, all this is a general trend toward developing
    standards that are extremely rigid: easy for automating software but
    hard for hand-coders. Wikipedia says the latest XHTML, v. 5, is designed
    for use with web apps; the developers viewed XHTML 2 as "too
    document oriented". (v. 2 apparently went to v. 5.)

    This looks like a rehashing of the XML fad and then the JSON fad:
    Very complicated ways of storing data that only a machine could love.
    It's faddish because the people using it are not actually working
    with it directly. They're using WYSIWYG tools where they can just plug
    in copy, images, etc, and the software will write the code.

    So I guess you'd need to figure out what version of XHTML you have
    and then get the docs for it. I'd look myself if I were curious, but to
    my mind life's too short for XML, XHTML and JSON. And too short for
    ebooks, too, for that matter. :) Though I actually wrote a simple VBS
    JSON parser in order to use REST API map functions from Google and
    Bing. JSON seemed less distasteful than XML, and it wastes a lot less
    bytes in its rigidity.

    For instance, I
    can't get a "<hr/>" to display.

    Isn't that "<hr />" ? This is crazy stuff. Heavy quoting. Case sensitive. Case sensitivity is another thing that's good for machines but not for
    human readability. With XHTML it seems to mean the same thing it means
    in C++
    and javascript: Virtually all keywords and variables will be lowercase,
    making
    the code flow harder to read, but occasional uppercase elements are thrown
    in to keep you on your toes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri May 31 15:18:10 2024
    Newyana2,

    So I guess you'd need to figure out what version of XHTML you have and
    then get the docs for it.

    :-) Yep, thats what I've been trying to do. Even the "basic XHTML" docs
    would help.

    I did find /some/ info about it, but as it shows "HR" as supported, but as
    the epub-reader doesn't display it (but luckily doesn't abort parsing
    either) ...

    For instance, I can't get a "<hr/>" to display.

    Isn't that "<hr />" ?

    While googeling I came across info that said that the space infront of that slash is just there so old webbrowsers would not barf. IOW, its not needed
    for XHTML (or for the more modern variants of HTML/webbrowsers).

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to R.Wieser on Fri May 31 14:31:00 2024
    R.Wieser wrote:

    Newyana2 wrote:

    So I guess you'd need to figure out what version of XHTML you have and
    then get the docs for it.

    :-) Yep, thats what I've been trying to do.

    <https://www.w3.org/TR/epub>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri May 31 16:34:08 2024
    Andy,

    So I guess you'd need to figure out what version of XHTML you have and
    then get the docs for it.

    :-) Yep, thats what I've been trying to do.

    <https://www.w3.org/TR/epub>

    I found a few myself :

    http://idpf.github.io/epub3-samples/30/samples.html

    https://idpf.github.io/epub-cmt/v3/

    https://www.w3.org/publishing/epub32/epub-contentdocs.html

    https://www.w3.org/AudioVideo/ebook/

    https://www.w3.org/2010/04/xhtml10-strict.html

    https://epubknowledge.com/docs/xhtml-general/

    https://www.yourhtmlsource.com/accessibility/xhtmlexplained.html/

    .... and somehow none of them actually mention which tags XHTML supports, or which tags are/must be supported by EPUB books (which I do not automatically consider to be the same set). :-(

    And assuming that there are different XHTML versions that EPUB readers
    should support, I have not found any specs to them either.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)