Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
c3d28aab
Commit
c3d28aab
authored
Jun 09, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base64 encode instead of escaping images.
parent
0664669c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
vnc.js
vnc.js
+8
-6
No files found.
vnc.js
View file @
c3d28aab
...
...
@@ -57,11 +57,11 @@ RFB = {
clipboardFocus
:
false
,
encodings
:
[
1
,
// COPYRECT, should always be first
0x17
,
// TIGHT_PNG
Math
.
pow
(
2
,
32
)
-
32
,
// JPEG quality pseudo-encoding
5
,
// HEXTILE
2
,
// RRE
1
,
// COPYRECT
0
// RAW
],
...
...
@@ -834,7 +834,7 @@ display_hextile: function() {
display_tight_png
:
function
()
{
//console.log(">> display_tight_png");
var
RQ
=
RFB
.
RQ
,
FBU
=
RFB
.
FBU
,
ctl
,
cmode
,
i
,
clength
,
color
,
strdata
,
img
;
ctl
,
cmode
,
i
,
clength
,
color
,
img
;
//console.log(" FBU.rects: " + FBU.rects);
//console.log(" RQ.length: " + RQ.length);
//console.log(" RQ.slice(0,20): " + RQ.slice(0,20));
...
...
@@ -902,12 +902,13 @@ display_tight_png: function() {
//console.log(" png, RQ.length: " + RQ.length + ", clength[0]: " + clength[0] + ", clength[1]: " + clength[1]);
RQ
.
shiftBytes
(
1
+
clength
[
0
]);
// shift off ctl + compact length
img
=
new
Image
();
img
.
src
=
"data:image/"
+
cmode
+
","
+
img
.
src
=
"data:image/"
+
cmode
+
RFB
.
extract_data_uri
(
RQ
.
shiftBytes
(
clength
[
1
]));
img
.
onload
=
(
function
()
{
var
x
=
FBU
.
x
,
y
=
FBU
.
y
;
return
function
()
{
Canvas
.
ctx
.
drawImage
(
this
,
x
,
y
);
};
var
x
=
FBU
.
x
,
y
=
FBU
.
y
,
me
=
img
;
return
function
()
{
Canvas
.
ctx
.
drawImage
(
me
,
x
,
y
);
};
})();
img
=
null
;
break
;
}
FBU
.
bytes
=
0
;
...
...
@@ -921,7 +922,8 @@ extract_data_uri : function (arr) {
for
(
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
stra
.
push
(
String
.
fromCharCode
(
arr
[
i
]));
}
return
escape
(
stra
.
join
(
''
));
//return "," + escape(stra.join(''));
return
";base64,"
+
Base64
.
encode
(
arr
);
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment