x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar204posts282karma

    Getting image from url without file extension

    Frederik T started this topic December 21, 2011 @ 12:22, Go directly to the topic solution

    i have this xslt that uses pictures with an url like so: http://www.mysite.com/image_db.asp?ID=12345

    works fine by its own in an img tag, but combined with imagegen, nothing shows up. I guess it either doesnt work because there isnt any kind of indication that its a picture (like no .jpg/.png etc.) or i am missing something?


  • Douglas Robar posted this reply December 21, 2011 @ 01:45

    Hi, Frederik,

    The issue is that ImageGen assumes the image= parameter is a local file. In your case it is a custom image handler. This is easy to use with ImageGen Professional - you simply need to include the full url (and domain) to your image handler and all should be fine.

    Your img tag's src= parameter would be something like this:

    /imagegen.ashx?width=100&image=http://www.mysite.com/image_db.asp?ID=12345

     

    This post is also good background reading to understand some of the issues and save you time if you run into problems.

    http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/23663-File-Not-Found

    cheers,
    doug. 


  • Avatar204posts282karma
    Comment with ID: 103210
    Frederik T posted this reply January 13, 2012 @ 12:22

    Late reply, but i finally got around and have the department buy a license for imagegen pro. The key is installed and tested that pro works.

    But it still didnt solve the problem in my original post for some reason.

    It is a little complicated but the end resulst suggests that it should be working.

    An xslt generates a list of people, those people are gathered from a webservice XML document. each person element has an "ImgUrl" element which in the for-each loop is outputted simply like this:

    <img src="{ImgUrl}" title="sample"/>

    and that works fine. now if i use it with imagegen like so:

    <img src="/ImageGen.ashx?image={ImgUrl}" title="sample"/>

    It doesnt work even though the outputted html is like this:

    <img class="ui-li-thumb" title="sample" src="/ImageGen.ashx?image=http://www.mysite.com/image_db.asp?ID=134918">

    it looks like the syntax is correct but nothing appears.

    Very odd indeed, but im sure i have overlooked something somewhere.


  • Douglas Robar posted this reply January 13, 2012 @ 12:33

    That does look correct so nothing immediately obvious. Any chance I can get a live url to the image so I can see it in action? That would help a lot.

    If you're uncomfortable posting the url here you can send it to me via my website's contact form (http://www.percipientstudios.com/about/contact.aspx)

    cheers,
    doug. 


  • Avatar204posts282karma
    Comment with ID: 103213
    Frederik T posted this reply January 13, 2012 @ 12:57

    Thank you for your time. Ive sent an example url using the contact form you posted above.

    I have a suspicion it might be a problem on our end, though i dont know how.


  • Frederik T posted this reply January 13, 2012 @ 01:58

    So just want to report back in case anyone else see's this thread, apparently it WAS an error on our side. To use images located on an external server, the host must be whitelisted in the imagegen.config:

    <RemoteDomainWhiteList>
       <Domain>www.mysite.com</Domain>
    </RemoteDomainWhiteList>

  • Douglas Robar posted this reply January 13, 2012 @ 02:01

    Glad to have helped you get it working. Thanks for sending me the url, that made it much easier to resolve.

    cheers,
    doug. 


Please login or Sign up To post replies