-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/app captured scan fixtures #35
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
Draft
TriForMine
wants to merge
5
commits into
main
Choose a base branch
from
fix/app-captured-scan-fixtures
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
88a3efc
feat(expo): add scan debug tooling, torch, and robust local save/export
TriForMine 73d2391
feat(expo): migrate debug save flows to new expo-file-system API
TriForMine 97ccbd9
fix: progress on app capture scan fixtures
TriForMine 4206cd3
feat: add the app scan fixtures
TriForMine 2d54f5e
scanner: add adaptive real-image crop/normalize debug pipeline with
TriForMine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: TriForMine/glyphnet
Length of output: 205
🌐 Web query:
expo-media-library saveToLibraryAsync localUri accepted file types image video svg💡 Result:
The expo-media-library saveToLibraryAsync function is designed to save images and videos to the user's device media library [1][2]. Regarding the file types: Images and Videos: The function natively supports standard image and video file formats, such as JPEG, PNG, and MP4 [3][4][5]. Ensure your localUri points to a valid file path, typically starting with file:// on Android [5]. SVG Files: The MediaLibrary API does not support saving SVG files directly to the device's photo/media library. Standard mobile operating system media galleries (iOS Photos and Android Gallery/Google Photos) are designed for raster images and video files [6]. If you need to save an SVG to the media library, you must first convert or export it to a supported raster format (like PNG or JPEG) within your application using a library like expo-image-manipulator or an image processing tool [6]. Common Troubleshooting: - Ensure you have the necessary permissions requested and granted (MEDIA_LIBRARY/CAMERA_ROLL) [3][4][5]. - Verify that your Info.plist (iOS) includes the required NSPhotoLibraryAddUsageDescription key [5]. - If you encounter a "This file type is not supported yet" error, ensure you are using a recent version of the expo-media-library package, as past issues related to file type recognition (especially for videos on iOS) have been addressed in recent updates [4].
Citations:
🏁 Script executed:
Repository: TriForMine/glyphnet
Length of output: 175
🏁 Script executed:
Repository: TriForMine/glyphnet
Length of output: 1035
🏁 Script executed:
Repository: TriForMine/glyphnet
Length of output: 8143
🌐 Web query:
site:docs.expo.dev media-library saveToLibraryAsync svg💡 Result:
In Expo/React Native, MediaLibrary.saveToLibraryAsync(localUri) saves a file (image or video) from a local URI into the user’s media library, but it is not documented as supporting SVG directly. What the official docs require 1) The argument must be an image/video file URI and “must contain an extension” [1]. 2) On Android, localUri “must be a local path” and “must start with file:///” [1]. 3) The saveToLibraryAsync API expects an image or video file: it is described as saving “the image or video file” at localUri to the user’s media library [1]. Implication for SVG - Because the API is documented specifically for image/video files (and does not call out SVG as a supported file type for saving), you should not assume that passing a.svg URI will work reliably. The docs only guarantee support based on being an image/video file with an extension [1]. - If your goal is to persist an SVG “drawing” to the media library, a robust approach is to render the SVG to a raster format (e.g., PNG) and then save that raster file via saveToLibraryAsync. If you’re using the newer expo-media-library API - Expo notes that saveToLibraryAsync is not available in the “new API”; the replacement is Asset.create(localUri), which saves the file and returns an Asset instance [2]. You’d still apply the same basic rule: provide a local URI to the file you want saved, with an extension as required by the underlying file-based approach [1][2]. Summary - Use MediaLibrary.saveToLibraryAsync(localUri) with a local file URI (Android: file:///...) that points to an image/video file with an extension [1]. - SVG is not explicitly documented as supported for saving via saveToLibraryAsync, so treat it as unsupported/uncertain and convert SVG to PNG/JPEG first if you need it saved to the gallery.
Citations:
Avoid calling
MediaLibrary.saveToLibraryAsyncwith the generated.svgfilesaveSvgwritesglyphnet-${Date.now()}.svgto the document directory, then (when permission is granted) callsMediaLibrary.saveToLibraryAsync(uri)on that.svgURI.saveToLibraryAsyncis intended for image/video files, and SVG support for direct media-library saving isn’t documented—so the “saved to library” path is unreliable. Convert the SVG to PNG/JPEG before saving, or skip the media-library step for SVG and go straight to the share/app-storage fallback. (docs.expo.dev)🤖 Prompt for AI Agents