This file contains 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
/* vips8 introspection demo | |
* | |
* compile with: | |
* | |
* gcc -g -Wall introspect.c `pkg-config vips --cflags --libs` | |
* | |
* try: | |
* | |
* ./a.out embed | |
* |
This file contains 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
// This source code is taken from Firefox Send (https://github.com/mozilla/send) and slightly modified. | |
export default async function saveFile(plaintext: ArrayBuffer, fileName: string, fileType: string) { | |
return new Promise((resolve, reject) => { | |
const dataView = new DataView(plaintext); | |
const blob = new Blob([dataView], { type: fileType }); | |
if (navigator.msSaveBlob) { | |
navigator.msSaveBlob(blob, fileName); | |
return resolve(); |