ImageAdapter.cs

Sep 30, 2007 at 12:13 PM
Hi Cristian,

have you changed this line of code in the imageadapter.cs on purpous, or is it one of those formatting erros that can happen in Visual Studio?
The code used to be:
return string.Format("{0}?w={1}&h={2}&img={3}",
VirtualPathUtility.ToAbsolute("~/Image.ashx"),
width,
height,
imageUrl);

But is now:
return string.Format("{0}?w={1}&h={2}&img={3}",
VirtualPathUtility.ToAbsolute("~/Image.ashx"),
width,
height,
imageUrl);

It's html encoded, but it breaks my code, don't know why it does not breat the code in your imagegallery.

(I use the code in a ImageGallery teaser. It picks a random image from the gallery and displays it on the sidebar.)

Regards,
Morten
Coordinator
Sep 30, 2007 at 3:34 PM
I can't spot any difference between the two versions. Maybe the imageUrl should be url-encoded by the adapter.

/Cristian
Sep 30, 2007 at 9:07 PM
No wonder you can't spot any difference :-)
The wiki is messing with my post :-)
The newst source contains a string where the ampersand is ecoded, but when it's returend it's not working in my code.
I did in previous versions of the code.
Have a look at, changeset 26773 for instance where it's not encoded versus the lates where it is.

The current source returns a link that at least my browser, IE 7, does not like.

//Morten