Skip to content

Commit

Permalink
Remove slide size probing from bbb-export-annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpetri1 committed Sep 24, 2024
1 parent b3d1e7d commit 82b02e7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@ trait MakePresentationDownloadReqMsgHdlr extends RightsManagementTrait {

val whiteboardId = s"${presId}/${pageNumber.toString}"
val presentationPage: PresentationPage = currentPres.get.pages(whiteboardId)
val xOffset: Double = presentationPage.xOffset
val yOffset: Double = presentationPage.yOffset
val widthRatio: Double = presentationPage.widthRatio
val heightRatio: Double = presentationPage.heightRatio
val width: Double = presentationPage.width
val height: Double = presentationPage.height
val whiteboardHistory: Array[AnnotationVO] = liveMeeting.wbModel.getHistory(whiteboardId)

val page = new PresentationPageForExport(pageNumber, xOffset, yOffset, widthRatio, heightRatio, whiteboardHistory)
val page = new PresentationPageForExport(pageNumber, width, height, whiteboardHistory)
getPresentationPagesForExport(pages, pageCount, presId, currentPres, liveMeeting, storeAnnotationPages :+ page)
} else {
getPresentationPagesForExport(pages, pageCount, presId, currentPres, liveMeeting, storeAnnotationPages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ case class AnnotationVO(id: String, annotationInfo: scala.collection.immutable.M

case class PresentationPageForExport(
page: Int,
xOffset: Double,
yOffset: Double,
widthRatio: Double,
heightRatio: Double,
width: Double,
height: Double,
annotations: Array[AnnotationVO],
)

Expand Down
152 changes: 4 additions & 148 deletions bbb-export-annotations/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bbb-export-annotations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"form-data": "^4.0.0",
"opentype.js": "^1.3.4",
"perfect-freehand": "^1.0.16",
"probe-image-size": "^7.2.3",
"redis": "^4.0.3",
"sanitize-filename": "^1.6.3",
"svgdom": "^0.1.17"
Expand Down
14 changes: 8 additions & 6 deletions bbb-export-annotations/workers/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import WorkerStarter from '../lib/utils/worker-starter.js';
import {workerData} from 'worker_threads';
import path from 'path';
import sanitize from 'sanitize-filename';
import probe from 'probe-image-size';
import redis from 'redis';
import {PresAnnStatusMsg} from '../lib/utils/message-builder.js';
import {sortByKey} from '../shapes/helpers.js';
Expand Down Expand Up @@ -322,15 +321,18 @@ async function processPresentationAnnotations() {
} else if (fs.existsSync(`${bgImagePath}.jpeg`)) {
backgroundFormat = 'jpeg';
} else {
logger.error(`Skipping slide ${currentSlide.page} (${jobId})`);
logger.error(`Skipping slide ${currentSlide.page} (${jobId}): unknown extension`);
continue;
}

const dimensions = probe.sync(
fs.readFileSync(`${bgImagePath}.${backgroundFormat}`));
// Rescale slide width and height to match tldraw coordinates
const slideWidth = currentSlide.width;
const slideHeight = currentSlide.height;

const slideWidth = parseInt(dimensions.width, 10);
const slideHeight = parseInt(dimensions.height, 10);
if (!slideWidth || !slideHeight) {
logger.error(`Skipping slide ${currentSlide.page} (${jobId}): unknown dimensions`);
continue;
}

const maxImageWidth = config.process.maxImageWidth;
const maxImageHeight = config.process.maxImageHeight;
Expand Down

0 comments on commit 82b02e7

Please sign in to comment.