Developer forum

Forum » Development » GetImage.aspx wrapper for image not available

GetImage.aspx wrapper for image not available


Reply
Hi there,

Im looking for a solution that provides a general noimageavailable.png when getImage.aspx returns with a 404 when image is not found so that in stead of ugly x in FF when an image does not exist there will be a default image.

is there a way to do this in the querystring let say:

/GetImage.aspx?Image=/files/blaat.png&width=100&height=100&noimageUrl=/images/noimageavailable.png

regards,
Niek

Replies

 
Nicolai Høeg Pedersen
Reply
Well - it is a good thought, and it will be available with 7.1.

We have made a number of improvements for the upcoming 7.1 for the GetImage.aspx
- New cropping features
- Performance improvements and threading
- Alternative image - like your suggestion

It will look like this:
/admin/public/getimage.aspx?Image=/Files/Billeder/Desert_Landscape.jpg&AlternativeImage==/Files/Billeder/DoesNotExist.jpg&Format=jpg&Width=350

By the way - you can always just access the GetImage.aspx in your browser with no parameters - then it will give you a dialog that helps you with all the settings - i.e. http://engage.dynamicweb-cms.com/admin/public/getimage.aspx 
 
Reply
We've been using the "AlternativeImage" part and it works very well.

I do have a question about how (and if even at all) GetImage caches images... I stumbled upon this when trying to implement the alternativeImage call. I figured that 'not-found' images would not be cached (because the server has to look if the image is available), but what I'm seeing is that not one image is cached on the server. Every image is cached in the browser but after a little while I see the image reloading (probably when the getImage call is ready and the server sends the appropriate response).

So to recap, is it possible to:
- have a serverside caching mechanism for GetImage calls (inlcuding the AlternativeImage part)?
- have a smarter "not updated" serverside response for AlternativeImage, so that "not-found" images stays cached in the browser (or even on the server)?
 
Reply

Images generated by GetImage.aspx is actually cached server side. They are placed in this folder: /Files/Cache.Net/Images.

For some reason, the client side cache has been disabled? Why?

I think the best solution would be to allow client side caching on generated images, but NOT on alternative images, because alternative images should be replaced by the actual image if this is uploaded later.

/Morten

 
Reply
As far as I can see, caching has not been disabled.
  System > Solution setup > Performance/Disable bowser cache is NOT enabled.

You could have a look here:
http://dev.sapph.mediaweb.nl

in particular: http://dev.nl.sapph.mediaweb.nl/nl-NL/shop/spring-summer.aspx

for the getimages.aspx parts I'm never seeing the response 304/not-modified. For all other images I am getting this. Perhaps this is because of the aspx call?

 
Reply
 
What i meant was that DW has disabled caching in GetImage.aspx (hard coded - expires in the past).

Static files are served by IIS, not DW.

/Morten 
 
Nicolai Høeg Pedersen
Reply
Oh - will fix the response header to use a 304 where appropiate.
 
Jacob Jensen
Reply
It would be nice to have an additional option for the alternative image part... a "if not present, remove img tag" option... In eCom we tell our clients to name their images PRODID_1.jpg, PRODID_2.jpg etc. so if we could just put 10 tags in our template with urls looking like below, the client(editor) would only need to upload the images needed an those would then be outputted, the excess tags would be stripped from the output. As it is now, we need to have the client check of x number of checkboxes to identify how many images he would like to have output. The whole process of selecting images manually via the filemanager on each product is way too time consuming:
admin/public/getimage.aspx?Image=/Files/Billeder/eCom/PRODID_1.jpg&AlternativeImage==Remove
admin/public/getimage.aspx?Image=/Files/Billeder/eCom/PRODID_2.jpg&AlternativeImage==Remove
admin/public/getimage.aspx?Image=/Files/Billeder/eCom/PRODID_3.jpg&AlternativeImage==Remove

 

You must be logged in to post in the forum