Skip to content

Commit

Permalink
fix problems with zip-images
Browse files Browse the repository at this point in the history
  • Loading branch information
yurygoru committed Nov 5, 2019
1 parent 3e14f11 commit 5b8cc0b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion cvat-core/src/frames.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
async function getFrameData(resolve, reject) {
function onDecode(provider, frameNumber) {
if (frameNumber === this.number) {
console.log("resolve frame : " + frameNumber);
resolve(provider.frame(frameNumber));
}
}
Expand Down
1 change: 1 addition & 0 deletions cvat-data/src/js/cvat-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class FrameProvider {
this._decodeThreadCount++;

worker.onmessage = (function (event){
this._frames[event.data.index] = event.data.data;
this._decodingBlocks[`${start}:${end}`].resolveCallback(event.data.index);
if (event.data.isEnd){
delete this._decodingBlocks[`${start}:${end}`];
Expand Down
1 change: 0 additions & 1 deletion cvat-data/src/js/unzip_imgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const JSZip = require('jszip');

self.onmessage = function (e) {

// frames = {};
const zip = new JSZip();
const start = e.data.start;
const end = e.data.end;
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/static/engine/js/cvat-core.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions cvat/apps/engine/static/engine/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,22 +891,22 @@ class PlayerView {
this._loadingUI.addClass('hidden');
if (this._latestDrawnImage !== image) {
this._latestDrawnImage = image;
this._playerCanvasBackground.attr('width', image.width);
this._playerCanvasBackground.attr('height', image.height);

if (window.cvatTask.mode === 'interpolation') {
this._playerCanvasBackground.attr('width', image.width);
this._playerCanvasBackground.attr('height', image.height);
const ctx = this._playerCanvasBackground[0].getContext('2d');
const imageData = ctx.createImageData(image.width, image.height);
imageData.data.set(image.data);
ctx.putImageData(imageData, 0, 0);
} else {
const ctx = this._playerCanvasBackground[0].getContext('2d');

const ctx = this._playerCanvasBackground[0].getContext('2d');
var img = new Image();
img.onload = function() {
this._playerCanvasBackground.attr('width', img.width);
this._playerCanvasBackground.attr('height', img.height);
ctx.drawImage(img, 0, 0);
};
img.src = image.data;
}.bind(this);
img.src = image;
}
}

Expand Down

0 comments on commit 5b8cc0b

Please sign in to comment.