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

App icns modification breaks the icon display on macOS #5590

Closed
asoluter opened this issue Jul 7, 2021 · 4 comments · Fixed by #5845
Closed

App icns modification breaks the icon display on macOS #5590

asoluter opened this issue Jul 7, 2021 · 4 comments · Fixed by #5845
Labels

Comments

@asoluter
Copy link

asoluter commented Jul 7, 2021

What did you do?

Modified *.icns file inside the app on MacOS

What did you expect to happen?

Updated icon to be visible using Finder/Get Info.

What actually happened?

After upgrading Pillow to 8.3.0 version, updating *.icns file inside the application on MacOS, makes the app icon not visible/invalid in Finder, though all the icons are visible if you open the icns file directly.

What are your OS, Python and Pillow versions?

  • OS: MacOS 10.15 Catalina
  • Python: 3.7.7, 3.9.7
  • Pillow: 8.3.0 or 8.3.1, 8.4.0
with Image.open(image_path) as image:
    draw=ImageDraw.Draw(image)
    draw.rectangle([(0,0), (image.width,image.height)], fill=(255,0,0))
    image.save(image.filename)
@radarhere radarhere added the macOS label Jul 7, 2021
@radarhere
Copy link
Member

Using an application on my computer, I'm not able to replicate this. Could you upload the original ICNS file? What version of macOS do you have?

@asoluter
Copy link
Author

asoluter commented Jul 8, 2021

@radarhere Sorry about the invalid example, I've rechecked it and it requires drawing prior to saving in order to break the icon (Finder may cache the old icon, so it's easier to see the change using Get Info option on the application). Not really sure if it's related to #4526 change, but the issue appeared after upgrading to Pillow 8.3.0

@asoluter
Copy link
Author

asoluter commented Nov 4, 2021

@radarhere I've updated the example section of description. It was tested with both MacOS 10.15 Catalina and 11.6 Big Sur. The issue is present in 8.4.0 as well.

@radarhere radarhere changed the title App icns modification breaks the icon display on MacOS App icns modification breaks the icon display on macOS Nov 16, 2021
@radarhere
Copy link
Member

Testing, I find that the problem is the file length in the header. I've created PR #5845 to resolve this.

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

Successfully merging a pull request may close this issue.

2 participants