➖ Remove unoconv python library (#322)
* ➖Remove unoconv python library
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { generatePreview as thumbnailsFromImages } from "./image";
|
||||
import { convertFromOffice } from "./office";
|
||||
import { convertFromPdf } from "./pdf";
|
||||
import { isFileType } from "../../../utils";
|
||||
import {
|
||||
@@ -10,7 +9,11 @@ import {
|
||||
} from "../../../../../utils/mime";
|
||||
import { PreviewMessageQueueRequest, ThumbnailResult } from "../../../types";
|
||||
import { generateVideoPreview } from "./video";
|
||||
import { Initializable, TdriveServiceProvider } from "../../../../../core/platform/framework";
|
||||
import {
|
||||
Initializable,
|
||||
logger,
|
||||
TdriveServiceProvider,
|
||||
} from "../../../../../core/platform/framework";
|
||||
import { cleanFiles } from "../../../../../utils/files";
|
||||
|
||||
export class PreviewProcessService implements TdriveServiceProvider, Initializable {
|
||||
@@ -26,17 +29,7 @@ export class PreviewProcessService implements TdriveServiceProvider, Initializab
|
||||
options: PreviewMessageQueueRequest["output"],
|
||||
): Promise<ThumbnailResult[]> {
|
||||
if (isFileType(document.mime, document.filename, officeExtensions)) {
|
||||
const pdfPath = await convertFromOffice(document.path, {
|
||||
numberOfPages: options.pages,
|
||||
});
|
||||
await cleanFiles([document.path]);
|
||||
const thumbnailPath = await convertFromPdf(pdfPath.output, {
|
||||
numberOfPages: options.pages,
|
||||
});
|
||||
await cleanFiles([pdfPath.output]);
|
||||
const images = (await thumbnailsFromImages(thumbnailPath.output, options)).output;
|
||||
await cleanFiles(thumbnailPath.output);
|
||||
return images;
|
||||
logger.info("Preview generation for office files currently not supported");
|
||||
}
|
||||
|
||||
if (isFileType(document.mime, document.filename, pdfExtensions)) {
|
||||
|
||||
@@ -3,10 +3,7 @@ FROM node:lts as node-base
|
||||
|
||||
### Install dependancies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y ghostscript graphicsmagick wget unoconv libxml2-dev ffmpeg python-is-python3 && \
|
||||
# upgrade unoconv
|
||||
wget -N https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/bin/unoconv && \
|
||||
chmod +x /usr/bin/unoconv
|
||||
apt-get install -y ghostscript graphicsmagick
|
||||
#Docker mac issue
|
||||
# RUN apt-get update && apt-get install -y libc6
|
||||
# RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
|
||||
|
||||
Reference in New Issue
Block a user