A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
editor: add comments for why we use UTITypes
Abdullah Attae43740c6bc85
diff --git a/packages/editor/src/utils/downloader.ts b/packages/editor/src/utils/downloader.tsindex b65f8f6ad..279e152e3 100644--- a/packages/editor/src/utils/downloader.ts+++ b/packages/editor/src/utils/downloader.ts@@ -16,10 +16,16 @@ GNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/+export type DownloadOptions = {corsHost: string;};+/**+ * macOS uses its own Uniform Type Identifier format instead of mime-types.+ * This is an incomplete map of UTI->mime-type for image types taken from+ * https://gist.github.com/RhetTbull/7221ef3cfd9d746f34b2550d4419a8c2+ */const UTITypes: Record<string, string> = {"com.microsoft.bmp": "image/bmp","com.canon.crw-raw-image": "image/x-canon-crw",@@ -77,6 +83,7 @@ export async function downloadImage(url: string, options?: DownloadOptions) {blob = new Blob([blob], {type: contentType});+return {blob,url: URL.createObjectURL(blob),