Menu

#579 Include a PF image from a public WW

workingwiki
open
nobody
None
5
2014-07-22
2014-07-15
No

Is there a recommended way to do this? See http://lalashan.mcmaster.ca/theobio/math/index.php/Don%27t_accept_the_null_hypothesis!/clarity (public page) for a common kind of failed attempt.

Related

Bugs: #579

Discussion

  • Anonymous

    Anonymous - 2014-07-15

    Does that work with other image URLs? I don't know much about including
    remote images in wikitext.

    OTOH, <project-file filename="vitamins.Rout-1.png" project="pe-ww:http://lalashan.mcmaster.ca/theobio/mmed:CI_diagrams"/>
    seems to work, though it seems to have problems displaying it during
    preview. I'll work on that bug.

    I'd say either approach is recommended (though I don't know what syntax
    to use in wikitext). I'd use the WW syntax if you want it to remake the
    file on demand, and use wikitext image inclusion
    (http://www.mediawiki.org/wiki/Help:Images,
    http://www.mediawiki.org/wiki/Manual:$wgAllowExternalImages) if you want
    more control over the image size, placement, etc.

     

    Last edit: Lee Worden 2014-07-15
    • Lee Worden

      Lee Worden - 2014-07-16

      I'd use the WW syntax if you want it to remake the
      file on demand

      though come to think of it, using that GetProjectFile URL also allows you to have it remake on demand

       
  • Lee Worden

    Lee Worden - 2014-07-15

    I'll work on that bug.

    Fixed: see [#580].

     

    Related

    Bugs: #580

  • Jonathan Dushoff

    Yes, my syntax works perfectly with ordinary image URLs, and AFAIK is the only way to get decent control over an external image on a wiki. I have now made a page with links to two identical-looking figures, included with identical syntax, but only one works. I guess it's something about how WW "serves" the GPF call, but it could also be something security-minded in WW (about the "get" parameters).

    http://lalashan.mcmaster.ca/theobio/math/index.php?title=Don%27t_accept_the_null_hypothesis!/image_syntax

     
    • Lee Worden

      Lee Worden - 2014-07-21

      Thank you for clarifying. I agree we want those to do the same thing.
      I'll look into it.

       
  • Lee Worden

    Lee Worden - 2014-07-21

    I guess it's something about how WW "serves" the GPF call,

    I kind of thought it would be something like this too, but

    but it could also be something security-minded in WW (about the "get" parameters).

    Actually it looks like it's something like this. Given this wikitext:

    Make our desired image into an APF, and use [http://lalashan.mcmaster.ca/theobio/mmed/images/2/20/CI_diagrams%24vitamins.Rout.0.png the Mediawiki location]:
    <img src=http://lalashan.mcmaster.ca/theobio/mmed/images/2/20/CI_diagrams%24vitamins.Rout.0.png width=70% alt="Effects of vitamins on three health indicators in fake children, with confidence intervals"/>
    
    Use the same image syntax, with the same image, but with the [http://lalashan.mcmaster.ca/theobio/mmed/index.php/Special:GetProjectFile?project=CI_diagrams&make=false&display=raw&filename=vitamins.Rout-0.png GPF-based URL:]
    <img src=http://lalashan.mcmaster.ca/theobio/mmed/index.php/Special:GetProjectFile?project=CI_diagrams&make=false&display=raw&filename=vitamins.Rout-0.png width=70% alt="Effects of vitamins on three health indicators in fake children, with confidence intervals"/>
    
    And again, with variant GPF-based URL:
    <img src=http://lalashan.mcmaster.ca/theobio/mmed/index.php/Special:GetProjectFile/project=CI_diagrams/make=false/display=raw/vitamins.Rout-0.png width=70% alt="Effects of vitamins on three health indicators in fake children, with confidence intervals"/>
    

    the parser is producing this HTML:

    <p>Make our desired image into an APF, and use <a rel="nofollow" class="external text" href="http://lalashan.mcmaster.ca/theobio/mmed/images/2/20/CI_diagrams%24vitamins.Rout.0.png">the Mediawiki location</a>:
    <img src="http://lalashan.mcmaster.ca/theobio/mmed/images/2/20/CI_diagrams%24vitamins.Rout.0.png" width="70%" alt="Effects of vitamins on three health indicators in fake children, with confidence intervals" /></p>
    <p>Use the same image syntax, with the same image, but with the <a rel="nofollow" class="external text" href="http://lalashan.mcmaster.ca/theobio/mmed/index.php/Special:GetProjectFile?project=CI_diagrams&amp;make=false&amp;display=raw&amp;filename=vitamins.Rout-0.png">GPF-based URL:</a>
    <img width="70%" alt="Effects of vitamins on three health indicators in fake children, with confidence intervals" /></p>
    <p>And again, with variant GPF-based URL:
    <img width="70%" alt="Effects of vitamins on three health indicators in fake children, with confidence intervals" /></p>
    

    That is, it appears to be suppressing the src attribute from the last 2. I'll look into whether it rejects Special: urls or something. The third test, which I added above, rules out GET parameters as the cause.

     
  • Lee Worden

    Lee Worden - 2014-07-21

    From a couple other test previews, I think that it doesn't recognize image URLs containing the '=' character.

    ... yes, replacing all '=' characters with its encoding '%3D' does work, in the variant URL syntax that also avoids use of '?' and '&':

    <img src=http://lalashan.mcmaster.ca/theobio/mmed/index.php/Special:GetProjectFile/project%3DCI_diagrams/make%3Dfalse/display%3Draw/vitamins.Rout-0.png width=70% alt="Effects of vitamins on three health indicators in fake children, with confidence intervals"/>
    

    Updated http://lalashan.mcmaster.ca/theobio/math/index.php/Don%27t_accept_the_null_hypothesis!/image_syntax with this working example.

    Hope that helps!

     
  • Lee Worden

    Lee Worden - 2014-07-22

    It's possible, though I haven't tried, that this situation might be improved by adding something to the image whitelist (http://www.mediawiki.org/wiki/Manual:$wgEnableImageWhitelist)

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.