Skip to content

Copy Text from Image - #2368

Open
iainx wants to merge 1 commit into
Dimillian:mainfrom
iainx:dev/iain/copytext
Open

Copy Text from Image#2368
iainx wants to merge 1 commit into
Dimillian:mainfrom
iainx:dev/iain/copytext

Conversation

@iainx

@iainx iainx commented Nov 14, 2025

Copy link
Copy Markdown

Add a button to the media edit view that uses VisionKit to analyse the image and use any text found as the image description.

Screenshot 2025-11-13 at 11 26 21 pm

It doesn't use the live text feature for two reasons

  • it isn't supported in SwiftUI's Image and using a UIImageView in the place of the Image didn't work easily to match the current design
  • the image could be scaled such that the text was so tiny it was unreadable and unselectable

With these reasons I thought just adding a second button was the easiest option.

Add a button to the media edit view that uses VisionKit to analyse the image and use any text found as the image description.
jadetheda pushed a commit to jadetheda/IceCubesApp that referenced this pull request Sep 6, 2026
This commit ports PR Dimillian#2368 from upstream (@ianinx), allowing users to automatically extract and copy text from media attachments to use as alt text descriptions.

Features:
- Imported `VisionKit` and added a `Copy text from image` button to `MediaEditView`.
- Implemented `generateText(url:)` which passes the downloaded image from `ImagePipeline` to `ImageAnalyzer` for optical character recognition.
- Fully guarded the VisionKit invocation behind `#if canImport(VisionKit) && !os(visionOS)` to prevent compiler failures on visionOS targets.
- Injected the missing `status.editor.media.copy-text` localization keys.
jadetheda pushed a commit to jadetheda/IceCubesApp that referenced this pull request Sep 6, 2026
This commit ports PR Dimillian#2368 from upstream (@ianinx), allowing users to automatically extract and copy text from media attachments to use as alt text descriptions.

Features:
- Imported VisionKit and added a Copy text from image button to MediaEditView.
- Implemented generateText(url:) which passes the downloaded image from ImagePipeline to ImageAnalyzer for optical character recognition.
- Fully guarded the VisionKit invocation behind #if canImport(VisionKit) && !os(visionOS) to prevent compiler failures on visionOS targets.
- Injected the missing status.editor.media.copy-text localization keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant