Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey there :)
We just discovered an issue that we havnt seen before, and we been using imagegen and a "few" sites now :)
So lets say we have an image in our solution named "udendørs.jpg" and if i request this in IE like this :
But if the request is this :
it fails with this line :
File not found: /media/1341727/udendrs.jpg
I understand why it fails because the image is not there under that given name. It only occurs in IE.
Ive tried to check all settings that its UTF8 and other wierd things that could occur. Ive checked in on a local solution aswell and it also seems to be an issue their.
I checked the http answer header :
just a quick update the imagegen class on the image is the following
<Class Name="ArticleTop" OverridesQueryString="true">
Only an IE problem, eh? Why am I not surprised? :P
Is it true in all versions of IE (7, 8, 9, and 10) or only older ones?
I will have a look on my end and see what I can find out.
Ofc its only in IE hehe (insert all curse words here followed by damn you IE)
Yea ive tested it in IE7-9
Just tried it on IE10... same problem. So that answers the question about which IE versions... all of them!
This won't work in IE
But when the filename is url-encoded like this it will:
So the immediate solution might be to url-encode the filenames in the macro so that IE will respond properly.
Yeah thought that would help will try to just encode it for now.
Do you have a time horizon for a patch for it ?
The site we have this issue upon is not live yet but just if we should start running through all our macro's/extensions and such to implement a work around or if you have a fix comming in a few week or so.
Another update, i noticed that it only occurs if we use &class option.
And this workaround works :
I'm still trying to understand exactly what IE is doing differently than the other browsers so no patch in sight just yet.
I have the problem all the time in IE, not just when using the &class option. Can you double-check if the &class option is making a difference? Or could it be any parameter, like the &width=200 parameter. That is, does it matter how many options you have on the querystring. You'll have image= of course (and that's enough for the error for me) and then you can add other params afterward. Does it have to be the &class= param or could it be anything?
What I have found is that IE only has this problem with querystring parameters that contain unicode chars. In the main url you can have unicode but not in the querystring... those have to be url encoded. I tested this by renaming imagegen.ashx to udendørs.ashx and it worked exactly the same as before the rename.
My head scratcher at this point is when does the url encoding need to happen if someone is browsing a site with IE? Should all querystrings being passed into imagegen be url encoded in the html that IE then displays? Or is it something that imagegen's server-side process can handle? At the moment I *think* it must be corrected in the html markup before ImageGen gets involved at all. But I don't want to give up too early and maybe someone understands the IE request pipeline better than I do.
One other question for you, Rasmus...
Right now we are putting the imagegen request directly in the url of IE's browser. Does the same behaviour happen when you're displaying images on a web page (in a gallery that has an image with the udendørs.jpg filename, for instance)? If so, what happens if you specify the character set of the html page to allow unicode (I got this idea from http://stackoverflow.com/questions/7864505/ie-sends-character-instead-of-unicode-characters-in-http-get)? Any difference?
If I have the following in my html markup (url-encoded automatically because I'm using a razor macro to generate the code in a gallery):
<ahref="/imagegen.ashx?image=/media/2488/udendørs.jpg&width=415&height=450&pad=true"> <imgsrc="/imagegen.ashx?image=/media/2488/udendørs.jpg&width=415&height=450&pad=true" /></a>
I then added a hard-coded link to the template so that Razor wouldn't encode things:
<a href="/imagegen.ashx?image=/media/2488/udendørs.jpg&width=415&height=450&pad=true"> <img src="/imagegen.ashx?image=/media/2488/udendørs.jpg&width=415&height=450&pad=true" /></a>
This behaved identically to the above.
What do we learn from all this?
I wonder if, in practice, this is a real problem that website users are likely to see?
If they are, you might consider creating a simple url rewrite rule that includes the image name as part of the url itself (which IE will encode/unencode properly) and the rest of the imagegen parameters on the querystring as normal. Perhaps using a url something like this:
I did this test :
<img src="/imagegen.ashx?image=/media/1341727/udendørs.jpg&width=200" />
This one works, and this is why we havnt had the problem before with other customers. Because this is our first customer where we use class.
<img src="/imagegen.ashx?image=/media/1341727/udendørs.jpg&class=GalleryThumbnail" />
This one DOSNT work. So something is different when we use the CLASS property.
BUT if i take the address directly in the browser then NEITHER works.
Both of those work just fine for me. In IE10 at least. So I'm not reproducing the same thing you have :(
Does it matter which class property you use? If not, what is in your GalleryThumbnail class (and any classes it inherits from)?
Goood morning my friend :)
Yeah i could see that they have it fixed in IE10.
The GalleryThumbnail looks like this :
<Class Name="GalleryThumbnail" OverridesQueryString="true"> <Width>110</Width> <Height>110</Height> <Constrain>False</Constrain> <Crop>Resize</Crop> <Align>Center</Align> </Class>
And it dosnt inherit.
Ive tried to write the same properties without using the class and it only confirms that the error must be in the class property :
The image is from IE9
And the code for these 2 images looks like this :
<img src="/imagegen.ashx?image=/media/1341727/udendørs.jpg&width=110&height=110&constrain=false&crop=resize&align=center" /><img src="/imagegen.ashx?image=/media/1341727/udendørs.jpg&class=GalleryThumbnail" />
I'm just going to butt in here. I was going to suggest this for nicer image urls. but actually I think it may help with your issue
Add the following to UrlRewriting.config
Then you can access your imagegen images which have a class like site.com/Imagegen/CLASSNAME/media/2323/hot-naked-girls.jpg
N.B. The regex will only allow you to have Any word character (letter, number, underscore) or an -
My thinking is that this will stop ie from doing weird things to your param, Havnt tested it however.
ill try it out immidietly
Cant get it to work, this is the rule :
Thats really strange, I copied that snippet direct from a working project.
Absolutely no idea why its doing that weirdness. Sorry :(
I'm terrible at regex, but what Stephen has recommended is a good workaround and exactly what I'd mentioned earlier. Thanks for the regex, Stephen!
But, since it isn't working properly (in a really weird way!), perhaps create the equivalent rewrite rule in the web.config file for IIS to handle directly rather than using Umbraco's urlrewriter?
Good morning, Rasmus!
I've reinstalled IE9 and done a few tests. Copying your GalleryThumbnail class was essential to reproducing the problem, thank you.
I haven't had a chance to look in-depth as to the reason, but for me, if I removed the <crop>Resize</crop> line from the class everything works properly ("resize" is the default mode for cropping so it doesn't need to be specified in this case).
With a few more experiements, I also found that if I changed the <crop> entry to a bogus setting everything still worked properly. For instance, <crop>foobar</crop>.
But when pasting in your class information afresh, the problem re-appeared.
I then double-clicked the word "Resize" in the imagegen.config file so that the whole word was selected and deleted it. I then re-typed the word "Resize" and saved the config file. And guess what... it still worked properly!
Though I can't see it, I can only guess there is something peculiar with a hidden character or some such nonsense in what you have in your config file and pasted into the forum. I don't understand it. But reliably for me, removing or replacing the "Resize" word in the class made things work properly. Only with your class as copied and pasted did I have a problem.
So... can you try what I've tried and let me know what you find out?
(in all cases, deleted the 'cached' folder and clear IE's browser cache to ensure you're seeing the fresh results of each change and not some cached result by either imagegen or the browser).
Ey Doug :)
ive deleted "crop" from my class, cleaned the cache, added nocache=true but its still not working sadly :(
Something ive noticed is that in IE it registeres the returned call as Text/html instead of image/jpeg.
Here is the answer header :
And the "content" of the answer :
If when you got time we could easily skype/teamview half an hour to see if we could break the mystic :) Then you could also see the setup
Well my friend, this one has me scratching my head. Perhaps a skype session would be best. Perhaps Wednesday mid-morning?
BTW, it returns 'text' because that's what is being returned in the error condition... a text message rather than an image. So that's okay.
Also done this in XSLT when re-applying values from the querystring to URLs generated within the page being rendered.
I don't know if it's a looser interpretation of some specs regarding Unicode charcters in URLs that makes the (all?) other browsers able to do the right thing...
Hehe yea it is a real scratcher indeed :)
yeah lets have some skype and biscuits tomorrow morning. Shall we say 10 gmt+1 (9ish at your place im gussing?)
You have my number hehe :)
A SOLUTION HAS BEEN FOUND.
We are using the extension to imagegen "AdaptiveImaging for Imagegen"(https://bitbucket.org/Rasmusfjord/adaptiveimages-for-umbraco) and apparently when ØÆÅ is contained in the query params comming from a call from IE it messes with the url. So when the plugin calls "context.Request.RawUrl" to get the full URL it changes the char's and in that way messes with it.
A fix has been applied at bitbucket.
Big cudos to Doug for spending a ton of time debugging with me :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted