Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle .ico #10

Closed
pixelastic opened this issue May 26, 2016 · 9 comments
Closed

Handle .ico #10

pixelastic opened this issue May 26, 2016 · 9 comments

Comments

@pixelastic
Copy link

Could be nice to be able to do a catimg ./favicon.ico to see what it looks like :)

@posva
Copy link
Owner

posva commented May 27, 2016

Hi!
That would be indeed nice. The lib I use for loading images doesn't handle ico files. Do you know about any tiny lib that does that? Otherwise I'd have to code it myself as I'm concerned about the final executable file size

@pixelastic
Copy link
Author

I know that the convert command utility that comes with ImageMagick should handle ico files.

$ convert favicon.ico txt:-
# ImageMagick pixel enumeration: 16,16,65535,srgba
0,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
1,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
2,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
3,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
4,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
5,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
6,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
7,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
8,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
9,0: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
10,0: (82.7451%,12.1569%,16.4706%,1)  #D3D31F1F2A2A  srgba(211,31,42,1)
11,0: (82.7451%,12.1569%,16.4706%,1)  #D3D31F1F2A2A  srgba(211,31,42,1)
12,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
13,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
14,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
15,0: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
0,1: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
1,1: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
2,1: (100%,100%,100%,0)  #FFFFFFFFFFFF0000  srgba(255,255,255,0)
3,1: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
4,1: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
5,1: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
6,1: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
7,1: (66.2745%,5.88235%,9.41176%,1)  #A9A90F0F1818  srgba(169,15,24,1)
8,1: (82.7451%,12.1569%,16.4706%,1)  #D3D31F1F2A2A  srgba(211,31,42,1)
9,1: (82.7451%,12.1569%,16.4706%,1)  #D3D31F1F2A2A  srgba(211,31,42,1)
...

@posva
Copy link
Owner

posva commented Jun 9, 2016

Sorry for the late answer. Adding support for those enumeration and adding a note on the help and readme seems enough. I'll find the time to do it someday 😅

@Addisonbean
Copy link

I just tried using catimg with an ico file, and it worked fine.

@posva
Copy link
Owner

posva commented Jul 2, 2016

You must have used the script 😄

@pixelastic
Copy link
Author

I'm not sure I'm following here. I just tried with http://www.google.com/favicon.ico and it failed

@posva
Copy link
Owner

posva commented Jul 4, 2016

There's the C program that is installed with brew and compiled with the Makefile and there's also a shell version at project's root that relies on ImageMagick to print images and therefore handle pretty much any format ImageMagick can handle

@pixelastic
Copy link
Author

I tried both version, script and binary and both were giving me errors with Google favicon:

Binary:
image

Script:
image

I then started hacking on my own Ruby version (repo here) and it's now working. It is way slower than your binary, though.

image

@posva
Copy link
Owner

posva commented Apr 18, 2017

Added in #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants