Add recognition for standard *.ico mime-type


#1

According to http://www.iana.org/assignments/media-types/image/vnd.microsoft.icon: the mime-type for *.ico is “image/vnd.microsoft.icon” (not that I agree - but it is the standard that a lot of sites seem to be using).

So ImageUtil.java probably should have

if("image/vnd.microsoft.icon".equals(mt)) return "ico";

somewhere in getFormatFromMimeType


#2

FYI. Per


image/x-icon is what is being used by everyone.


#3

Well that’s certainly what I would hope and expect.
Perhaps you could help me assess what I’m missing; see if you can grab this . . .
https://en.wikipedia.org/favicon.ico
. . .
and make it an image with ImageNew()

All I see is that Lucee can’t find the format for image/vnd.microsoft.icon

In detail . . .

    icoIco = "https://en.wikipedia.org/favicon.ico";
    testImg = "./tmp/icoTest" & timeformat(now(),'hhmmssSS') & ".ico";
    cfhttp(url=icoIco, method="get");
    filewrite(testImg,cfhttp.filecontent);
    img = ImageNew(testImg);

#4

Yea Wiki uses image/vnd.microsoft.icon. Not even Microsoft does. Try adding:
cfcontent(type=“image/x-icon”, file=testImg);
after filewrite and see if that works?


#5

The cfcontent certainly lets me display the file, so that mime-type works!
But I need to do some processing on it. And I can’t figure out how to get that data to imageNew()

Every favicon.ico that I go to seems to be image/vnd.microsoft.icon. It looks to me that folks servers are just set to use the IANA standard even tho it’s not really right.

I also wonder if every *.ico seems to be vnd.microsoft.icon because something is up with mime-typing on my system; but I’ve futzed with all sorts of mime-type maps and the system seems to keep saying either that it can’t load the file or it can’t find the format for image/vnd.microsoft.icon.

Still playing . . . I’ll post more if I find it.


#6

Aaahhhh - I didn’t search hard enough. Bug. Already logged.

https://luceeserver.atlassian.net/browse/LDEV-1620