teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

編集

2018/08/18 05:54

投稿

hiryu-
hiryu-

スコア8

title CHANGED
File without changes
body CHANGED
@@ -59,8 +59,8 @@
59
59
 
60
60
  // JEPGファイルの作成
61
61
  if (option == 2){
62
- var png = canvas.toDataURL("image/jpeg").replace("data:image/jpeg;base64,","");
62
+ var png = canvas.toDataURL("image/jpeg").replace("data:image/jpeg;base64,",""); // ←エラーが出るのはこの行です
63
- png = window.atob(png); // ←エラーが出るのはこの行です
63
+ png = window.atob(png);
64
64
  var Stream = AsciiToUint8Array(png);
65
65
  SaveToFile(Stream,'dest.jpg');
66
66
  }

2

編集

2018/08/18 05:54

投稿

hiryu-
hiryu-

スコア8

title CHANGED
File without changes
body CHANGED
@@ -18,8 +18,8 @@
18
18
 
19
19
  ```
20
20
 
21
-
21
+ ### ソースコード
22
-
22
+ ```
23
23
  <!DOCTYPE HTML>
24
24
  <html>
25
25
  <head>

1

コードブロックで囲ってみました

2018/08/18 05:52

投稿

hiryu-
hiryu-

スコア8

title CHANGED
File without changes
body CHANGED
@@ -12,15 +12,14 @@
12
12
  ### 発生している問題・エラーメッセージ
13
13
 
14
14
  ```
15
- エラーメッセージ
16
15
  index.html:41 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
17
16
  at onClick (file:///C:/Users/hirose/Desktop/crista/xxxz/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC/%E3%83%A9%E3%83%B3%E7%9D%80%E3%81%9B%E6%9B%BF%E3%81%88%20-%20%E3%82%B3%E3%83%94%E3%83%BC/index.html:41:22)
18
17
  at HTMLButtonElement.onclick (file:///C:/Users/hirose/Desktop/crista/xxxz/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC/%E3%83%A9%E3%83%B3%E7%9D%80%E3%81%9B%E6%9B%BF%E3%81%88%20-%20%E3%82%B3%E3%83%94%E3%83%BC/index.html:145:33)
19
18
 
19
+ ```
20
20
 
21
- ```html5
21
+
22
- ### ソースコード
22
+
23
- ```
24
23
  <!DOCTYPE HTML>
25
24
  <html>
26
25
  <head>