* [NTG-context] externalfigure regression?
@ 2023-12-04 7:51 Thangalin
0 siblings, 0 replies; only message in thread
From: Thangalin @ 2023-12-04 7:51 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1112 bytes --]
Hi,
>From the wiki <https://wiki.contextgarden.net/Command/externalfigure>:
"When the file extension is .auto or method=auto is used, ConTeXt reads the
first few bytes of the file to determine the filetype. Such an
auto-discovery is useful for remote images that do not have a file
extension."
current version: 2023.09.26 18:19
Code:
% SOT
\starttext
\startplacefigure
\externalfigure[https://placekitten.com/408/287][method=auto]
\stopplacefigure
\stoptext
% EOT
Expected: Cute kitten photo.
Actual: Error.
Is this a regression? Or has the syntax changed (stale wiki)?
Specifying the type works (I'd've thought it not necessary to specify the
method at all, given both magic headers and HTTP content-type could
determine the type):
% SOT
\starttext
\startplacefigure
\externalfigure[https://placekitten.com/408/287][method=jpg]
\stopplacefigure
\stoptext
% EOT
See also:
https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaTypeSniffer.java#L53
https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaType.java#L218
[-- Attachment #1.2: Type: text/html, Size: 1943 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:[~2023-12-04 7:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 7:51 [NTG-context] externalfigure regression? Thangalin
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).