Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 07, 2009 @ 10:57
    Kim Andersen
    0

    Possible to change the "Hello, World!" image

    Hi Doug

     

    Is it possible to change the image(or text?) that says "Hello, World!", if an image is not found?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 07, 2009 @ 11:50
    Douglas Robar
    1

    No, you can't change the text itself.

    But you can specify an ?altImage= that will be used if the source image isn't found. I use this a lot in staff listings... when a person's headshot isn't available ImageGen will use an alternate image (an outline silhouette) instead. I could check for this situation in my macro code but having ImageGen take care of it simplifies my macros.

    cheers,
    doug.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 07, 2009 @ 13:48
    Kim Andersen
    0

    Can I just add the altImage to the string that I'm already using then?

    Right now this is the code I'm using:

    /umbraco/ImageGen.ashx?image=<xsl:value-of select="$imgUrl"/>&amp;width=200

     

    How would it look if I want to add the altImage then?

     

    Because right now, the "Hello World" is of course show if an image have been deleted from the media-section, but not removed from a page.

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 07, 2009 @ 14:07
    Douglas Robar
    2

    Check the docs for all the details, but this would be the kind of think you'd do...

    /umbraco/ImageGen.ashx?image=<xsl:value-of select="$imgUrl"/>&amp;altimage=/media/missing.jpg&amp;width=200

    cheers,
    doug.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 08, 2009 @ 20:39
    Kim Andersen
    0

    Thanks Doug.

     

    My bad that I didn't check out the documentation first. I simply didn't think about it. But this works perfectly.

     

    /Kim

  • katz 5 posts 25 karma points
    Oct 25, 2009 @ 12:37
    katz
    0

    Hi,

    I use ImageGen.dll in my website(not umbraco).

    When I write

    http://localhost/MySite/ImageGen.ashx?image=http://localhost/MySite/images/temp/44-89-ArticleImage1.jpeg&width=132&height=132

    I get

    Images must be local to the webserver or in the whitelisted domain list.

    What do I need to change to fix it?

    Thanks,

    Katz

  • katz 5 posts 25 karma points
    Oct 25, 2009 @ 12:39
    katz
    0

    Hi,

    I use ImageGen.dll in my WebSite(not umbraco).

    When I write

    http://localhost/MySite/ImageGen.ashx?image=http://localhost/MySite/images/temp/44-89-ArticleImage1.jpeg&width=132&height=132

    I get Images must be local to the webserver or in the whitelisted domain list.

    What do I need to change to fix it?

    Thanks,

    Katz

  • rich hamilton 117 posts 136 karma points
    Mar 21, 2012 @ 16:55
    rich hamilton
    0

    This helped, but would be good if you could add some default text in the dictionary or in the querystring.

  • Ivan 165 posts 543 karma points
    May 02, 2013 @ 13:06
    Ivan
    0

    Hi guys.

    I would like to replace "Hello World" image with my own one.

    Do I still need using "&altimage" param or there's better solution now?

  • Rich Green 2246 posts 4008 karma points
    May 02, 2013 @ 13:14
    Rich Green
    0

    Hey Ivan,

    Did you try it out?

    Rich

  • Ivan 165 posts 543 karma points
    May 02, 2013 @ 13:20
    Ivan
    0

    Hi Rich.

    Yes, It works fine. But the problem is that I would need to touch every .xslt in my project and explicitly add that parameter. This is something I'm hopping to avoid.

  • Rich Green 2246 posts 4008 karma points
    May 02, 2013 @ 13:28
    Rich Green
    0

    Hey Ivan,

    Understood, you could try adding the parameter to the default class in config/ImageGen.config ?

    (Have no idea if this works)

    Rich

  • Ivan 165 posts 543 karma points
    May 03, 2013 @ 11:56
    Ivan
    0

    Hey Rich,

    Config modification doesn't seem to work, so I've decided to go with url param. Anyway it would be great to have this feature in next versions of the package.

Please Sign in or register to post replies

Write your reply to:

Draft