* [NTG-context] Issues with included images on some epub readers
@ 2024-12-28 11:04 Florent Michel
0 siblings, 0 replies; only message in thread
From: Florent Michel @ 2024-12-28 11:04 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2305 bytes --]
Hi,
I'm not sure whether the following is an issue with ConTeXt or with the
epub readers I'm using; my apologies for the noise if it's not relevant to
this list!
I was experimenting creating ebooks with ConTeXt, and found it works
very well on most epub readers (except with Calibre, as was previously
reported on this list) as far as text is concerned, although I am having
issues displaying images. Images appear correctly in the exported html file
when opened with Firefox or Chromium, so I suspect the issue may either
come from difference in specs for the epub and html formats or from bugs in
the epub readers I have tried (Mupdf, Koodo, and Foliate).
Example showing the issue:
_____________________________________
% test.tex
\setupbackend
[export=yes]
\setupinteraction
[title={\documentvariable{title}}]
\startdocument[title=Test EPUB]
% Some text
\samplefile{tufte}
% Include a simple MetaPost image
\starttextdisplay
\startimage
\startMPcode
fill fullcircle scaled 3cm withcolor darkred ;
\stopMPcode
\stopimage
\stoptextdisplay
% Some text again
\samplefile{tufte}
% Include an equation as SVG image
\starttextdisplay
\startimage
\startformula
e = \frac{m c^2}{\sqrt{1 - v^2 / c^2}}
\stopformula
\stopimage
\stoptextdisplay
\stopdocument
_____________________________________
I compile it using
_____________________________________
mtxrun --script epub --images test.tex
context test.tex
mtxrun --script epub --make test.tex
_____________________________________
Render from Koodo 1.5.1 (correct): https://pasteboard.co/4bUcUdaJim9m.png
Render from Koodo's latest version (1.7.2):
https://pasteboard.co/xRfDCYx9zki4.png
All recent epub readers I have tried (Mupdf, Foliate, Okular) produce a
similar incorrect rendering.
I am not very familiar with the epub format specs so I don't have a
good feel for where the issue may come from. It seems that manually adding
<img alt="image-1" src="../images/test-exported-1.svg">
in the .html file makes it appear with recent epub readers, though.
Is it possible to have the html output generated by ConTeXt include images
in this way (or tune the way images are included in another way which may
work better with recent epub readers)?
Cheers,
Florent
[-- Attachment #1.2: Type: text/html, Size: 2752 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-28 11:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-28 11:04 [NTG-context] Issues with included images on some epub readers Florent Michel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).