3

I am trying to insert a remote image into a pdf but although the image is available, Context cannot insert it into the document. I just have a grey square in place of the image.

Here is a MWE:

\starttext    

\startsection[
  title=Digits 0-10]

\startsubsection[title=0]

\tfd{Hose}
\externalfigure[https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg][width=2cm]
\stopsubsection

\stopsection

\stoptext

Update to @aditya questions: Context version: current version: 2017.03.02 22:23 Curl: installed Output:

graphics        > inclusion > using locations 'local,global'
graphics        > inclusion > using paths '. .. ../..'
resolvers       > schemes > hashing 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg' to 'https-cdn-vectorstock-com-i-thumb-large-48-82-green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg'
resolvers       > schemes > fetching 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg', protocol 'https', method 'curl'
JFIFHHhttp://ns.adobe.com/xap/1.0/<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:creator> <rdf:Seq> <rdf:li>VectorStock.com/15644882</rdf:li> </rdf:Seq> </dc:creator> </rdf:Description> </rdf:RDF> </x:xmpmeta>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <?xpacket end="w"?>C











C
        D
!1AQaq#2BRbCSrDc$%4!1AQaq2R#b34BCr
                                  ?S@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ALd gePQ²MS<t𷜒e*Dy&J8A^mE3֊jۮWbM8&KN<G5OX꛴0ufx4v+Vso*H.$#`tqˮu<G[i[[KN+I{ǣw{|gKGc+د5=#Ž~^^&)sSGQK3'{A^>-N8ˆό2bcx\)P =ehҐt*qlCޑ
H*쳗PT1G<3P
=F̝
 liM[YkD-3ӓYyֳ޾o/4)$dva
                       z:ςwOZ7\                fxH=ócXofkjZRH0|xǂ7&&iG-j촕X#)q2yOV]w[+*%m,hW&yn?ddn#;ܞ>Sٍ֟e[c\ek]Y#5ku;iORJHϒKGǢvO4[TlUiQ
                                                                                                                                         0^n>YZWsV"nqz7Z
            n
             "li!lDg%j+gzplrwõ>$n'Oܗgi =T=t41Բ2LĔwu6*z|shVMup8%ڽ!sZwzmh*7
                                                                         -d+m xԨ٥       \pU]G
KZt"]2<\ZV=";2j{<M%#X;h"->FMqy
yGQ˲WIl:WLČ8vm;#o_vM)'Oǡ^޾u
                           gRզFu;:IsKag'SZ?S%K[j˖k$jKvr($:Æ9`#?|4v\mUSp 5GDLGD^RǸ}!DnՅ?jj48t$k<9t[wJ;tM[-8iᦥa@֏<R
88 {uzp9?x%K=fLU=rOKVt<y҂[od73Kg'ܪ?x+S8=un
                                          /df%}Zkc5j$h?IP]bYf5Q\EԿ;^IMGz:fu5'o*c6kV٧|YޫknVwM(Yw%kk2L/
3GDMY;W$.qo;~{ZY\t7my.}fYϚOe[B:pLa,jw=ٶ,F97|V߿Z<[Mx}Cç"CЮ
                                                         WU^IsDevSj8Y#y.7zORjFW4+h-~eyYMQ3~>dǎ
*)82?<'qNK~ԏaД5D=+~49xƺ־=#O޸9{B9}Q{r<NV]v~-/t-ZgwB[DrI`TS7iYSfJy
                                                                 ˊ[13#k{cyۃ1-L,JjX\XI*۶
]?Rpw\GX^Q83N>qV;[FQFw[%h=)ώ13,EQI.hqw,.aUVmKAڶ6mnkE}Ioadaj5^MMuֺkΤj8
                                                                     :*j{o)QdʷJC_5oю[cuGV:5:W#[>>
缴?9eo)Zjnoc궾RcrZ>24%D,Y{yPS
tIdֳ]ѺiڢQ-bX]ry!>&-5vx'Hz'r>k_lsl= 9Kx,9gm=lUhmn"hcғS躏E4
/;-mz%ScQ`IafV{}IH]QRCd@ںy$nALkOHEֳB5SjuQuAqq-#/9SO{7m>$`CySQr=m
                                                                [USKKRc/r8Ó_cKCZ:12    ou}M؇p*H,䨖os\xT{J7SGFwx*LDmU;G
                                                                                                                        Z'M%AcM;sT[/OM%T8ےzL,QHE)d/$vUgjd6Dec,O>Մ2V!V&ccPw$f~glAa70Zy,s|{G/YBT_k\CcL`1_mDǜ
XعIkc?T]iMTZ)~cN!nrJ!$-ZRfRУly)ĩ`?@tAfvȰ^
                                          uOcvZI[Bִ
                                                   gʛ[ixD{]o`p;
)GyQ=>USvE,1dv
               sdTDѥKK\cu-vf;<dc1_Lx~h)}MM;˥nFÍ%c       ~3Q/Iّz44       A-+4Ҟ1A3`nk]g4%b:NZoς8giYǣya^Xq)Re]&(Z\sfd1wܱ_t@IW'.\Y=#9VG
                                                                                                                                   Oo
mhoT淘ʹD緘
9c`㜯^tOF=f",OG%cGQy,Wz{cyo識wWkM}b|հuy]';efNĴc/^h.adXZ#+6O     ⍱F-4IӰ`ulv3Mdخtrݨ⒖
                                         tO     Rci覫H>!mz-jw6m3CvxB'T?0p{Voh>м揔]hoec
                                                                                      Ê/Vrg۬\t؎jW)}%"]I{nc
                                                                                                          #6oklrpkX$;bvG%[J
OʹL|>                                                                                                                      Xgs[Ʌ-ƣG}
     ^^MUkA&gn6+fuWQ^ig;۴{ǟ
                           mj|s4x"QsUԽSH^Iq(^Y+v]|>MSjW
&PtXĒO+rw乤OLy=008LN~VH<ĸg{˸2'5<-_e}I                  ]yoGn8siQroy3G2iMˤGU${6Smn
#}e<61oiAr=;Ď(mƚiˬ,X9SxHs<,DC^RFw#ptO>TcZU8|N_&ԚPUuG-^meg{kMTN$ۤ,ݐ1TJ7N-rC~So4`^m^?/l~^<{u<mR]j(lԴ펑a\3ܴc=uF(a6X9f/[_nAT<Phmxe
                                                                                                                              NE^0َ;f(ߧvPy^f
8Zw5^M9
       P,#L'4PؘIgF޼)mmgvqa^nnR\'a       kF~xg
dOkumv=:Fre                                  i?ogޮAk=aK-$ۨ>}3i6uahѶlR߶b:9
92QA6W51yar:zݧ˷:CG+}Ƀ'z8c⸬~fD_)IXJO|Vunqɬn=$X7lv_AD߯M<g <Wg䷫ms|K쬘7VBmӻGUզku~ߥ۬
P=gһҷˋlB*I]>k~m)Θ9I+:[hSqxa.>m[zז<ce[$lTueƣ#@t]Ḹ}&+ɭb7B7{15Xfs3q!Mけqg          a$h\SShTfܕMcn/ϊ~WzGYƨ-w]lQI{N
                                                                      k{W
                                                                         nPesolvers       > schemes > using missing 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg', protocol 'https'
graphics        > inclusion > unknown url 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg'
  • I can retrieve graphics via http:// but not https://. – Ulrike Fischer Dec 14 '17 at 19:15
  • OK. Something clearly went wrong. It appears that the jpeg file is written to STDOUT rather than the cache. 1. Can you check if you have write permissions on TEXMFCACHE (you can find out the directory by running luatools --expand-var TEXMFCACHE). 2. Does running curl from commnad line work correctly? In particular, does curl --silent --insecure --create-dirs --output /tmp/file.jpg https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg create /tmp/file.jpg file? – Aditya Dec 15 '17 at 18:08
  • @Aditya: I do have write permissions in TEXMFCACHE. Running curl saves the image to /tmp/file.jpg – pdoak Dec 16 '17 at 10:49
  • Sorry, I am out of ideas. For some strange reasons, curl is writing file to STDOUT rather than to the specified file. If the image is also available via http, you can switch to http and everything should work because http is processed via Lua Socket library. If you do need https then you can try updating ConTeXt installation and see if that helps (because the example works at my end with the latest ConTeXt). If not, I can try to create a wrapper using filter module, a la placekitten – Aditya Dec 16 '17 at 17:10
3

This is not an answer, but it contains more information than can be conveyed in a comment.

  1. Which version of ConTeXt are you using?
  2. https files are retrieved using curl. Do you have curl installed?
  3. You can get better idea of what is happening by running:

    context --trackers=graphics.locating,resolvers.schemes --directives=schemes.threshold=0 --once test  
    

On my system, this gives

resolvers       > schemes > hashing 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg' to 'https-cdn-vectorstock-com-i-thumb-large-48-82-green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg'
resolvers       > schemes > fetching 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg', protocol 'https', method 'curl'    
resolvers       > schemes > using cached 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg', protocol 'https', cachename '/home/adityam/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/schemes/https-cdn-vectorstock-com-i-thumb-large-48-82-green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg'    
graphics        > inclusion > file '/home/adityam/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/schemes/https-cdn-vectorstock-com-i-thumb-large-48-82-green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg' has format 'jpg'    
graphics        > inclusion > url 'https://cdn.vectorstock.com/i/thumb-large/48/82/green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg' is resolved to '/home/adityam/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/schemes/https-cdn-vectorstock-com-i-thumb-large-48-82-green-garden-hose-agriculture-tool-cartoon-vector-15644882.jpg'    
graphics        > inclusion > format 'jpg' natively supported by backend

As the second line above shows, the file is being fetched using curl. The flag --directives=schemes.threshold=0 is to force a download of a file (normally a file is cached and redownloaded only if the cache is more than a day old).

  • updated question to answer your questions. – pdoak Dec 15 '17 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.