Hi,
I had some mistakes in my previous postings, but now I understand the problem better:
Internet Explorer does not do color-management, so the image looks the same whether it has a profile or not. The same, but not as I see it in Adobe Lightroom.
Firefox does color-management. So if there is a color profile, the image looks exactly like I see it in Adobe Lightroom. If there is none, the image looks like in Internet Explorer. When switching gfx.color_management.mode to 1 then Firefox does color-management, even if there is no profile in the file, it just assumes sRGB. So if the original picture was exported in sRGB, the re-sized one without profile looks correct in mode 1.
Since besides Firefox also Safari does color-management and IE9 will do it as well, it was important to me to retain the color profile. I switched my code to ImageMagick, and that works fine. Color profiles are retained when resizing the image.
Cheers, Robert