... I wonder what the header does:
00 00 01 00 01 00 00 00 00 00 01 00 20 00 52 36
06 00 16 00 00 00 [png file starts here]
-Krishean
It is the icon header consisting of:
00 00 - marker part 1
01 00 - marker part 2
01 00 - number of images in the .ico file
following the entries for each image in the .ico file (1 in this case):
00 - width (0=256)
00 - height (0=256)
00 - color count (only applies to images with palette)
00 - reserved
01 00 - planes (always 1)
20 00 - color depth in bits (32 in this case)
52 36 06 00 - length of the image data
16 00 00 00 - offset of the image data in the file
As I said before, max. allowed size is 256x256 pixels. This is an invalid .ico file, because the size specified in the header differs from the actual size. Icons usually contain multiple images (that's the point of .ico files) and Windows chooses the best image by looking at the header. Invalid header -> Windows is confused. If you had both 256x256 and 512x512 images in the .ico file, Windows would see them as indistinguishable.
Also, what's the point of having an .ico with 512x512 image instead of plain .png image? I do not think Windows can effectively use it, the icon sizes Explorer and other windows components display are limited to 256x256 pixels anyway.