mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
editor: add comments for why we use UTITypes
This commit is contained in:
committed by
Abdullah Atta
parent
6123bccf4b
commit
e43740c6bc
@@ -16,10 +16,16 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along 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),
|
||||
|
||||
Reference in New Issue
Block a user