MCPcopy Index your code
hub / github.com/CapSoftware/Cap / importImageFromPicker

Function importImageFromPicker

apps/desktop/src/utils/importMedia.ts:73–86  ·  view source on GitHub ↗
(options?: ImportOptions)

Source from the content-addressed store, hash-verified

71};
72
73export const importImageFromPicker = async (options?: ImportOptions) => {
74 const result = await dialog.open({
75 filters: [
76 {
77 name: "Image Files",
78 extensions: imageExtensions,
79 },
80 ],
81 multiple: false,
82 });
83 const path = selectedPath(result);
84 if (!path) return null;
85 return await importImagePath(path, options);
86};
87
88export const showImportError = async (
89 mediaType: "video" | "image",

Callers 2

handleImportImageFunction · 0.90
handleImageImportFunction · 0.90

Calls 3

selectedPathFunction · 0.85
importImagePathFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected