| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- --- services/filestore/app/js/FileConverter.js
- +++ services/filestore/app/js/FileConverter.js
- @@ -22,49 +22,44 @@ export default {
- }
-
- async function convert(sourcePath, requestedFormat) {
- - const width = '600x'
- + const width = 1500
- return await _convert(sourcePath, requestedFormat, [
- - 'convert',
- - '-define',
- - `pdf:fit-page=${width}`,
- - '-flatten',
- - '-density',
- - '300',
- - `${sourcePath}[0]`,
- + 'pdftocairo',
- + '-png',
- + '-singlefile',
- + '-scale-to-x',
- + width.toString(),
- + '-scale-to-y',
- + '-1',
- + sourcePath,
- ])
- }
-
- async function thumbnail(sourcePath) {
- - const width = '260x'
- - return await convert(sourcePath, 'png', [
- - 'convert',
- - '-flatten',
- - '-background',
- - 'white',
- - '-density',
- - '300',
- - '-define',
- - `pdf:fit-page=${width}`,
- - `${sourcePath}[0]`,
- - '-resize',
- - width,
- + const width = 700
- + return await _convert(sourcePath, 'png', [
- + 'pdftocairo',
- + '-png',
- + '-singlefile',
- + '-scale-to-x',
- + width.toString(),
- + '-scale-to-y',
- + '-1',
- + sourcePath,
- ])
- }
-
- async function preview(sourcePath) {
- - const width = '548x'
- - return await convert(sourcePath, 'png', [
- - 'convert',
- - '-flatten',
- - '-background',
- - 'white',
- - '-density',
- - '300',
- - '-define',
- - `pdf:fit-page=${width}`,
- - `${sourcePath}[0]`,
- - '-resize',
- - width,
- + const width = 1000
- + return await _convert(sourcePath, 'png', [
- + 'pdftocairo',
- + '-png',
- + '-singlefile',
- + '-scale-to-x',
- + width.toString(),
- + '-scale-to-y',
- + '-1',
- + sourcePath,
- ])
- }
-
- @@ -78,7 +73,8 @@ async function _convert(sourcePath, requestedFormat, command) {
- const timer = new metrics.Timer('imageConvert')
- const destPath = `${sourcePath}.${requestedFormat}`
-
- - command.push(destPath)
- + const outputBaseName = sourcePath
- + command.push(outputBaseName)
- command = Settings.commands.convertCommandPrefix.concat(command)
-
- try {
|