Skip to content

Conversation

@Gae24
Copy link
Contributor

@Gae24 Gae24 commented Oct 14, 2024

Used png for handling images on all platform. On macOS dropped the dependency on core-graphics since now an image is directly stored as png

@Gae24 Gae24 changed the title macOs: switch to png for image macOS: switch to png for image Oct 14, 2024
@Gae24 Gae24 force-pushed the mac-png branch 4 times, most recently from 3203d92 to c283f81 Compare October 17, 2024 14:52
@complexspaces
Copy link
Member

Hey there, thanks for the PR. Similar to the first PR which tried this, can I ask that you do some basic compatibility testing to make sure this doesn't regress any major use cases? Some examples would be:

  • Copying image to and from Firefox, Chrome, and Safari
  • Copying image to and from Pages and/or Word
  • Copying image to and from TextEdit

@Gae24
Copy link
Contributor Author

Gae24 commented Oct 19, 2024

Unfortunately at the moment I don't have access to an Apple device.

@complexspaces complexspaces added waiting on author Further information is requested O-Apple Work related to the macOS or iOS clipboard waiting on review The change is currently waiting on an arboard maintainer for a review or larger-scale update labels Jun 18, 2025
@complexspaces
Copy link
Member

I'm marking this one with both waiting on author and waiting on review since in theory either of us can perform the testing. No pressure here though, I'm just doing some status triage and cleanup.

@complexspaces complexspaces added the enhancement New feature or request label Jun 18, 2025
@complexspaces
Copy link
Member

I spent some time testing this today and my conclusion is that I believe we will need to continue to support TIFF on Apple platforms in order to retain compatibility with pasting images from Apple's own apps.

In my testing I used Chrome, Firefox, Screenshot tool, and a bunch of Electron apps. All of these had no issues with providing data in a PNG format. However when I tried pasting an image supplied by Pages.app, it failed. After some debug printing I saw that it only offers it in TIFF or HEIC (which image doesn't support).

I did try a different approach (getting a bitmap of RGBA from CGImage) that would support either PNG or TIFF more transparently but ran into another memory leak in Apple's image frameworks. When decoding TIFF data it leaks ~100 bytes, even inside of an autorelease pool. When decoding PNG there's no problems though. I guess it becomes a question of:

  • How much do we care about consistency across platforms?
  • How much do we want to drop the Rust tiff crate?
  • Do people use TIFF enough in the "real world" via clipboard to run into the memory leaks?

@complexspaces complexspaces removed waiting on review The change is currently waiting on an arboard maintainer for a review or larger-scale update waiting on author Further information is requested labels Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request O-Apple Work related to the macOS or iOS clipboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants