mklement0 / fileicon

macOS CLI for managing custom icons for files and folders
440 stars 20 forks source link

[Q] how to check if passed icon is the same as app already has? #47

Closed ZuBB closed 10 months ago

ZuBB commented 10 months ago

Is it possible to come up with any check if the passed icon is the same as the app already has?

I tried to md5 but the checksum is different for .icns file and the result of get command for same icon

mklement0 commented 10 months ago

Yes, it seems like transformations can happen behind the scenes that result in a different binary file when you extract the image.

I'm afraid I don't know how to compensate for that - short of round-tripping an assigned image, which may not be practical (by that I mean: assign, extract, and keep the extracted form as a reference copy; if a given file or folder has this reference copy assigned, extracting it will apparently retrieve an exact copy of it).

ZuBB commented 10 months ago

ok, I got the idea. will try to "cook" smth in that direction.

thanks for the answer