UNPKG
fix-orientation
Version:
latest (1.1.0)
1.1.0
1.0.0
0.0.2
0.0.1
0.0.0
Rotate images if their exif data says so.
github.com/Wayla/fix-orientation
Wayla/fix-orientation
fix-orientation
/
lib
/
resize.js
10 lines
(8 loc)
•
243 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
module
.
exports
= resize; function
resize
(canvas, o)
{
var
ctx
=
canvas.getContext(
'2d'
);
var
imgData
=
ctx.getImageData(
0
,
0
, o.width, o.height); canvas.width = o.width; canvas.height = o.height; ctx.putImageData(imgData,
0
,
0
); }