2009/03/20

(null) requests from IE8

I've noticed since the release of the IE8 Beta 2 some strange request for non-existing pages: the requests are something like this "http://www.mydomain.com/(null)"

The only thing in common between those request is the user agent, always IE8 using the Trident 4 engine:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)

It might include other toolbars or add-ons, but that's the common part for all of them. Most are using XP, but there is also some Vista requests.

The only page that I've been able to find so far is this thread that is focused just in how to ignore those request, instead of trying to understand the reason why are generated.

I'm afraid that now that the final IE8 has been finally released the number of such bogus "(null)"  requests will increase at a very fast pace, so the only solution will be to set a rule to ignore it as just another bug in IE8 and don't get flooded with the 404 error.

2009/03/15

The pain of supporting IE6

In this day and age it's a pain the fact that IE6 is still out there. Every web developer that have spend a little time trying to make a page or script work cross-browser and include IE6 in the set of supported browsers knows it.

I guess that if everything goes right and MS doesn't make any big mistake the release of Windows 7 will be a tremendous help in order to see IE6 go away. We all know that too many companies have been holding on XP due to the bad words about Vista, but for the moment they have managed to get good press for W7, so it won't be strange that not too long after it's released more and more companies that have been delaying the upgrades to their workstations or that have bought new ones but immediately replaced Vista with XP will be more positive to get Windows 7 and that way the included IE8.

Movements like the one started in Norway are a step forward, most of the average user doesn't know anything about internet or a browser, so when they see a similar message in every page that they visit they might get a clue and finally update to IE7 or (if we are really lucky) to any of the other browsers. Of course this isn't the first movement, there are previous ones we just need to send the message out, it doesn't matter where you did read it. The statistics show that following the current trends IE6 should slip to something like 10% usage at the end of this year. And I guess that the release of IE8 will help that number to get even lower.

As stated too many times, the usage between home and office is very different and the message usually only will be able to force the change at homes, but what happens when they go back to the office and their browser there doesn't behave the same way that it does at home?, when they can't use tabs? when the pages look slightly wrong? At some time they will be able to force the change of policies and get the IE7 update and that's good.

But this isn't just about the users and their browsers. If you are a web developer you can help every body: don't create pages in Quirks mode. As soon as you add the correct doctype to your pages you have done the right thing, it will be much easier to create pages that will behave the same way in different browsers and will make some of the IE6 problems go away. Of course it isn't perfect and IE6 must die, but you will be able to forget about it for a little while. You can read about the goodness of Standards mode by a CSS Expert

What does it mean that you use standards mode for anyone else?

As long as you use any third party library, a lot.

If the developers of any javascript library can forget about supporting IE6 and its Quirks mode it means that they have one browser/mode less to test on. Not only that, every other browser also have slight differences in Quirks mode, so it means a lot of time saved just by a little change to your pages. As you see, you don't need to force the change on the users to make the web go forward, just say no to Quirks mode.

If you want to use an updated script for your page, why can't you update your page so it follows the standards?

More voices are starting to cry out "that's enough" and some have suggested setting Dec 31th, 2009 as the end date for IE6 support. I think that's a good movement forward: we can't force people to change their browsers, but we can't waste our time and money supporting such a beast that doesn't allow us to focus in newer features, simpler code,and in general look forward instead of being forced to code the same way that we had to do eight years ago.

I will be glad to hear from everybody that they won't be supporting new developments on IE6+QuirksMode any longer, the sooner the better.

2009/02/15

GoogleMaps 1.98

This release fixes a little problem using the GoogleMaps_PublicKey setting and adds Chinese and Norwegian translation.

Of course, no new work is expected in the 1.x versions.

2009/02/01

Releases

I wanted to post something about several releases of different products, but I didn't have the time until now.

Let's start from oldest to the most recent.

CKFinder 1.3

This release fixes all the problems (at least for asp) known in previous versions, it's the work of several months trying to debug each and every report from the users.

Adding over that, it also includes some enhancements like ability to select the thumbnails themselves and remember the last selected folder.

ImageMap 2.1

I still need some time to update the demo page (and zip) in my server. This is update is just the job of Adam, and the parts related to the FCKeditor plugin are the ability to use Zoom and general bug-fixes and memory leaks. I'll try to really test it asap but I'm a little busy :-(

Internet Explorer 8 RC1

It seems that this release can be really tested, they have fixed lots of bug (included the two that I reported related to FCKeditor), improved performance, and I guess that we all really should test it to avoid finding two months after release that we didn't test it and it did include some regression that makes us suffer again. I don't expect any other releases shortly, just like IE7 I guess that we will have to wait a lot for something new, so this is the time for us to test it and check that it's really getting closer to the rest of the browsers. Let's hope that hopefully IE8 along the release of Windows 7 (I guess that it will be released much sooner than most of the people expects it) makes IE6 fade away.

FCKeditor 2.64

This is one of the last releases of the 2.x series of FCKeditor. It includes lots of bug fixes, I would had included even more little fixes but time is finite and it isn't possible to do everything that one would like to. This release isn't just bug fixes, it also includes support for table headers and a zero-configuration online spellchecker. If you are using any 2.6x version it's a no-brainer to update, your users will be pleased if they ever faced any of the bugs and you shouldn't have any problem to use it.

Let's remember also, that the 3.x versions are called CKEditor and you can start taking a look at it right now with the first beta that has been released, the online demo of the nightlies is available here. Almost everything is being rewritten, it isn't an easy task but the results so far are looking great.

 

2009/01/24

GoogleMaps v2.1 finished (including user docs and bug fixes)

Finally I've updated the documentation for the end user regarding the new features available in the Google Maps plugin version 2.1, but I've fixed also some little details that did appear after the initial testing period.

All the current customers of the v2 will receive shortly a mail with the new zip.

Some clarifications regarding the plugin:

If you want to use the plugin for free, then you must use the v1 code. It's free to use wherever you want, you can test it in that page and then download it and install it in your server to use with FCKeditor.

If you appreciate the work involved to make that version work, or if you want to use all the new features and want to use the v2 plugin, then you must contact me (until I setup an automatic system), the license for a single site is 15€, if you are any kind of OEM or company that want to use it for several sites, you can get a general license for 50€.

Of course, you should really test the free version before trying to use the v2, as the requirements and setup procedure are just the same. If you have the v1 working, to upgrade to the v2 you just need to replace the plugin folder and that's all, no extra job. There's no online demo or download trial of the v2 plugin, this is all javascript, so it's not worth for me trying to implement any kind of security to avoid the people that want to get everything for free.

2009/01/06

Text markers and static maps with GoogleMaps plugin

I've finished the coding of the new 2.1 version of the GoogleMaps plugin, the main highlights for this new version are:

Text markers.

You can add your text on the map, aimed at providing an always visible caption for the details that you want to remark.

The title field of normal markers now it's shown as a text besides the marker, and you can add any other text in the map using the Text tool.

This feature is based on the ELabels script provided by Mike Williams, I have simplify it a little to remove unwanted features and decrease its size.

Static images generation.

Ok, the previous version did generate a static image and then loaded the map, but this version does provide an option to not generate any script at all, and most important: it's able to edit again those images.

In the previous versions you were able to copy the image around or manually remove the script from source code, but if you tried to edit it again, it didn't recognize any of its data, so it wasn't very useful. Now it can generate the image without any scripts and then recover all the data that it's used on that image (I mean: data as text labels, areas, kml overlays... won't be recovered because they aren't used in the static maps).

This can be useful if you want to provide the option in a kind of forum where anybody can create data, but you don't want them to use any script due to obvious security reasons.

The scripts now are precompressed using YUICompressor in order to improve loading time, if you want to use the original files in order to make any adjustment or debug anything you just have to rename the files.

Now I need to update the docs and then it will be send to the current users. If you want the script and until I set up an automated system you can mail me at amla70 at gmail dot com and I'll provide you the PayPal info.

2009/01/01

Optimizing the generation of gifs in .Net

While debugging some problems that a client had with CKFinder I found out that the thumbnails that were generated using the asp.net code of gif files were in reality png files, just a little oversight and should be easy to fix. Previously the code did test only for jpg files in order to adjust the quality, and the rest of extensions did were saved with

oResampled.Save( targetFile );


But as I said, the .Net framework doesn't check the extension of the file that you want to generate, instead it uses the png format.

So the new code just needed to do a switch:

switch ( extension )
{
    case ".gif":
        oResampled.Save( targetFile, System.Drawing.Imaging.ImageFormat.Gif );
        break ;
    case ".png":
        oResampled.Save( targetFile, System.Drawing.Imaging.ImageFormat.Png );
        break ;
    case ".bmp":
        oResampled.Save( targetFile, System.Drawing.Imaging.ImageFormat.Bmp );
        break ;
}
easy fix, isn't it?

You're wrong, for some strange design decision at MS, decreasing the palette from full color to 256 colors uses the infamous "web safe" palette, so your page will look again like those done at the start of the times, back when Nestcape was synonymous to Internet.

Why has the .Net team gone that way at this time and age?. I don't care, I didn't want to know why it's done that way, I just wanted to know how to do it the right way, how to specify a proper palette for the new file.

So searching a little you can find this very interesting article at MSDN that explains everything that you want to know about gifs and colors, it has links to other resources that try to explain the miracle that is a web safe palette, but it has been years since I saw a system that wasn't able to work with 24 bit-images.

That article does even include a sample that shows exactly how to do the quantization of images and provides also an implementation of an Octree palette generator. Too good to be true :-)

So there we go, add the class and quickly I see that there are some strange attributes on the classes. "unsafe", uh?

Let's recap: the article was written for the .Net Framework 1.1, and nowadays the servers in hosted providers are using mostly (AFAIK) Asp.net 2.0 in medium trust, so that code won't work at all.

Fortunately there was another nice blog by Brendan Tompkins that did found this same problem and does provide an explanation of the required changes in order to run properly. So I tested and now I didn't get the same compilation problems that I had with the original code, the unsafeness seemed to have gone away.

But when I tested really with medium trust, oh no!, a System.Security.SecurityException! Did I make something wrong?

I reviewed the changes and used directly the modified classes, nops, no way, it fails. Reading the comments I found that other people also reported the same problem but no one answered them. Could it be that initially the code did work in .Net 2.0 but some patch later the behavior was changed and now the calls to Marshal aren't allowed?

Searching to find the solution to this problem hasn't been successful, no one seems to know a solution and I spent one or two days reading everything that seemed interesting trying different combinations of search terms. Even trying to find another method to do the quantization hasn't been fruitful, there are questions posted in different places but no one has provided a positive answer.

Obviously I don't need to read the raw memory of the picture, using GetPixel seems that should be enough to create the palette, but this isn't the final solution because to generate the new picture with the specially created palette I need to specify the color/index of each pixel, and when you try to use SetPixel, you get:

"SetPixel is not supported for images with indexed pixel formats"

And again the solutions to this problem suggest to use the LockBits and then writing directly to memory, but that will fail in Medium Trust.

To recap:

  • If you're running in High Trust, CKFinder 1.3 the asp.net or asp version (with asp.net handling) will create gif thumbnails correctly
  • If you're in Medium Trust the call to create the 256-colors image will fail, and so far we haven't been able to find any solution. The GetPixel method is useful only for half of the process, it does still require direct memory access to create the new image so it hasn't been implemented. In this situation the "gif" image is really a 24-bit color png, not optimal and if someday the browsers stop sniffing the content of images they won't be shown, but hopefully before we reach that day MS would have released .Net v8 with some api to control the color-reduction method and/or SetPixel method expanded to handle indexed images.