mklement0 / fileicon

macOS CLI for managing custom icons for files and folders

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

APFS / macOS 10.13 (High Sierra) support ?

kwent opened this issue · comments

Hi,

Thanks for this amazing tool !

Not sure but i think i started seeing that issue with new Apple Filesystem APFS.

➔ fileicon set toto icons/Icon.png
xxd: /var/folders/lq/1qvftx4s4yv1g4g_p15ds4hr0000gn/T/fileicon.aUp2LEAJ/Icon.png/..namedfork/rsrc: No such file or directory
Failed to create resource fork with icons. Typically, this means that the input file is not a (valid) image file: /var/folders/lq/1qvftx4s4yv1g4g_p15ds4hr0000gn/T/fileicon.aUp2LEAJ/Icon.png
fileicon: ERROR: ABORTING due to unexpected error.

System specs:

OSX 10.13 | APFS

➔ uname -a
Darwin 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

Thoughts?

Thanks for letting me know - bummer.

I haven't had a chance to look at APFS and macOS 10.13 yet - not sure when I'll get a chance.

If you have insights yourself, please share them.

I can reproduce the same error even on my iMac with Fusion Drive (so, not APFS).

Thanks, @FezVrasta. I've added a warning to the read-me for now.

Just tried on my work laptop running on 10.12.6 and i actually have the same issue... (I don't see the line referencing xxd in the output tho)

uname -a
Darwin IC-C02P22LPG3QP 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
➜  fileicon set toto.url 562646.svg
Failed to create resource fork with icons. Typically, this means that the input file is not a (valid) image file: /var/folders/4h/d9hrx_5948l8rt91q6qh6hv40000gp/T/fileicon.k2hWCPnL/562646.svg
fileicon: ERROR: ABORTING due to unexpected error.

@kwent: The behavior is expected in your case, because SVG is not a supported image format.

The sips CLI that fileicon uses under the hood supports the following formats:

jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga

Dammit i'll retry tomorrow. Maybe we can also improve this error message and list formats your mentioned ;)

Confirmed. Work well on 10.12.6 .

Unfortunately, the news isn't good:

Apple removed the -i / --addicon command from the sips utility in macOS 10.13, so fileicon set no longer works (the other subcommands still do, but that's little consolation).

For now, I've pushed an update that implements an explicit check for trying to use fileicon set on macOS 10.13+ and issues an error message.

I'll look into alternatives, but this may take a while - help is welcome.

@kwent: On macOS 10.12- I've updated the error message to explicitly list the supported image formats if you pass an unsupported image file.

What version of sips do you have in macOS 10.13 ?

I have macOS 10.13 and sips 10.4.4 and i can see the -i / --addicon command available when sips --help

Regards

@kwent: To add insult to injury, they not only removed support for the option, but also forgot to update the CLI help (they removed it from the man page, however).

Here's what happens if you try to use it on macOS 10.13 (you'll need a valid image file to see the error):

$ sips -i t.png
--addIcon is no longer supported

@kwent: To be clear: they removed the feature, but forgot to update the CLI help.

Bummer... So no workaround ? I wonder why this has been removed ...

Good news: I've just published v2.0, which uses an embedded Python script that calls a Cocoa API, courtesy of this Ask Different answer, so fileicon set now works on macOS 10.13 too, both on HFS+ and APFS volumes.

A beneficial side effect of this change in implementation is that now a set of icons is created, with the highest-resolution icon measuring 512 x 512 pixels (previously, due to use of sips -i, a single icon was created, at a resolution of 128 x 128).

Oh my.... Thanks for the time you spent to find a workaround !!! Amazing ownership 👍