Copied to clipboard

Flag this post as spam?

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


  • Tony Kiernan 278 posts 341 karma points
    Oct 07, 2011 @ 15:46
    Tony Kiernan
    0

    "Object reference not set to an instance of an object" Known issue?

    I have been using ImageGen quite happily on a site fora week or so.  The images used are updated fairly regularly.  Today, they jut stopped appearing.  When I tried to look just at the handled image eg

    http://www.blackbear.co.uk/ImageGen.ashx?image=/images/Bikes/9900630220110929153579281.jpg&width=170&nocache=true

    I got the message

    Object reference not set to an instance of an object

    The image was there. I've reinstalled and everything seems happy again, but this is not ideal. Is there anythoning known I should be considering?

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Oct 07, 2011 @ 16:36
    Douglas Robar
    0

    Hi, Tony,

    Please, please, don't use the &nocache=true setting, that's for debugging only and definitely not good for a live site. With &nocache=true your server will recreate the resized image rather than using an already-cached version, which will put a significant load on your server... it tells ImageGen to behave as though there is no cached file, even if there really is.

    As for the object reference error... there's nothing unusual in your example request (except the nocache setting) so I'm very surprised. Even if an image is removed right out from under ImageGen you should simply get a file not found message. If it happens again, please let me know and hopefully there will be some common scenario that will allow us to identify the root of the problem.

    cheers,
    doug. 

  • Tony Kiernan 278 posts 341 karma points
    Oct 07, 2011 @ 16:45
    Tony Kiernan
    0

    I am aware that there might be an issue with the nochache, but I'd rather the site served up images over the weekend.  I'll remove it on Monday

  • Tony Kiernan 278 posts 341 karma points
    Oct 07, 2011 @ 17:23
  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Oct 07, 2011 @ 17:29
    Douglas Robar
    0

    Both links look great to me. What's the problem?

    cheers,
    doug. 

  • Tony Kiernan 278 posts 341 karma points
    Oct 07, 2011 @ 17:39
    Tony Kiernan
    0

    So they do.  They didn't a minute ago.  I'm confused

  • Tony Kiernan 278 posts 341 karma points
    Oct 07, 2011 @ 17:45
    Tony Kiernan
    0

    I had in the meantime deleted some older dlls (upgraded site) and restarted the site

  • Markus Johansson 1646 posts 4635 karma points c-trib
    Jun 25, 2015 @ 08:25
    Markus Johansson
    0

    Hi!

    Did you figure out how you solved this? I have a simular issue atm.

  • Markus Johansson 1646 posts 4635 karma points c-trib
    Jun 25, 2015 @ 08:57
    Markus Johansson
    1

    I my case it turned out that everything worked fine if i change to using the complete url in the querystring.

    ImageGen.ashx?image=/images/myimage.jpg&width=170
    

    But when I used a class:

    ImageGen.ashx?image=myimage.jpg&class=myclass
    

    I got the "Object reference not set to an instance of an object"-error.

    Turned out that this appeared after I have installed SEO Checker and used the "force www"-setting as this will redirect all requests to a domain starting with www.

    My class had an

    My temporary solution is to disable the "force www"-setting.

    / m

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jun 25, 2015 @ 12:22
    Douglas Robar
    0

    Hi, Marcus,

    Sounds like you've found the cause of the problem. As for why it works okay without the class but SEOchecker gets in the way when you use the class I'm not sure since they should be making the same request?

    What do you have in the class in the imagegen.config file? Are you supplying a host name in addition to the path? If so, that could be the problem if SEOchecker intercepts the request and alters it.

    cheers,
    doug.

  • Markus Johansson 1646 posts 4635 karma points c-trib
    Jun 26, 2015 @ 08:16
    Markus Johansson
    0

    Hi

    Yes the issue is solved =D Your spot on, that was the issue.

    So what happened was that the class had a

    <ImageBaseDir>http://static.yada.com/images/</ImageBaseDir>;
    

    I know that this was probably a bad idea as the files are on the local server, this configuration (that I inherited) would have ImageGen to think that the image files are external right?

    Any way. ImageGen fires of a request to grab the image file from http://static.yada.com/images/ (which just points to the Umbraco-installation but trough a CDN proxy). Since this is the same installation as the www.yada.com-site SEO Checker (with the force-www setting) will redirect all request going to http://static.yada.com/images/ so that the forced www is included http://www.static.yada.com/images/ and my DNS was not configured to server the www.static-subdomain.

    My solution was to change the

    The reason that it worked without the class was that ImageGen when directly to the disk to get the file and not used the request as above.

    Cheers Doug!

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jun 26, 2015 @ 08:28
    Douglas Robar
    0

    Perfect!

    You're correct, when the

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft