ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: Hans Hagen <pragma@wxs.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Downloading long urls
Date: Fri, 21 Jan 2011 19:20:44 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1101211902460.8633@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <4D3A0E76.7000108@wxs.nl>

On Fri, 21 Jan 2011, Hans Hagen wrote:

> What exactly do you mean with the suffix issue?

Consider

  \externalfigure[http://contextgarden.files.wordpress.com/2008/08/logo-alt41.png]

The current implementation downloads this file as

<path-to-current-cache>/http-contextgarden.files.wordpress.com-2008-08-logo-alt41.png

Then external figure sees a file with .png extension, and correctly 
includes it.

If you follow my suggestion, the file will be downloaded as

<path-to-current-cache>/667816068B899068327DA1EF013B3943

Then external figure sees a file with no extension, assumes that the file 
is a pdf file, and the figure inclusion fails. To correct that, you need 
to add [method=png] to \externalfigure.

> We can probably normalize things a bit.

Agreed. Perhaps the best option will be a file name like

http-contextgardent.files.wordpress.com-667816068B899068327DA1EF013B3943.png

(so normalized base url + md5sum of url + extension). I am not sure how if 
extensions can be calculated reliably in urls. In particular imaging 
something like

http://www.bing.com/search?q=check+.extension+long+url+so+that+os+filename+limit+exceeds+....

A simple algorithm with assume that everything following the dot is the 
extension, while that is certainly not the case here. We can definitely 
restrict the search of extension to the last 10 or so characters of the 
url, but there will be cases when such heuristics will fail.

> Concerning the gibberish ... we can put a file alongside with some info. 
> I need to think a bit about it but indeed it makes no sense to have 
> redundant mechanisms.

Thanks,
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2011-01-22  0:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-16  5:12 Aditya Mahajan
2011-01-21 17:15 ` Aditya Mahajan
2011-01-21 22:53   ` Hans Hagen
2011-01-22  0:20     ` Aditya Mahajan [this message]
2011-01-23 20:22       ` Hans Hagen
2011-01-23 20:34         ` Aditya Mahajan
2011-01-23 20:54           ` Hans Hagen
2011-01-23 21:10             ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1101211902460.8633@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).