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
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to