Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Failed to convert page to image. convert: symbol lookup error: /usr/lib/libraqm.so.0: undefined symbol: fribidi_get_bracket_types #33

Open
ajiratech2 opened this issue Mar 6, 2018 · 1 comment

Comments

@ajiratech2
Copy link

I've installed Imagemagick, Ghostscript and poppel on Arch linux on a Aarch64 hardware (Odroid C2 like system). Arch kernel is 3.14.29 , I cannot upgrade the kernel and must stay on this.

I've also installed pdf-image module to use with node. When I try to convert a PDF file to jpg image I get the following error message:

`[test@test ~]$ node convertPdf2Jpg.js
Error occured: { message: 'Failed to convert page to image',
error:
{ Error: Command failed: convert -colorspace RGB -density 300 -interlace none -quality 100 "./scan_000864.pdf[0]" "/home/test/Extras/images/scan_000864-0.jpg"
convert: symbol lookup error: /usr/lib/libraqm.so.0: undefined symbol: fribidi_get_bracket_types

at ChildProcess.exithandler (child_process.js:272:12)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Socket.stream.socket.on (internal/child_process.js:348:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
 killed: false,
 code: 127,
 signal: null,
 cmd: 'convert -colorspace RGB -density 300 -interlace none -quality 100 "./scan_000864.pdf[0]" "/home/test/Extras/images/scan_000864-0.jpg"' },

stdout: '',
stderr: 'convert: symbol lookup error: /usr/lib/libraqm.so.0: undefined symbol: fribidi_get_bracket_types\n' }`

Here is the code that I have. (FYI, this code works perfectly on another Intel based Ubuntu machine with latest kernel).

`
var PDFImage = require("pdf-image").PDFImage;
var path = require('path');
var util = require('util');

function convertPDFTOJPG(pathToPdf) {

const pdfImageOpts = {
outputDirectory: path.join(__dirname, './images'),
convertExtension: 'jpg',
convertOptions: {
'-colorspace': 'RGB',
'-interlace': 'none',
'-density': '300',
'-quality': '100'
}
};

var pdfImage = new PDFImage(pathToPdf, pdfImageOpts);

pdfImage.convertPage(0).then(function (imagePath) {
// 0-th page (first page) of the slide.pdf is available as slide-0.png
console.log("Converted.");
fs.existsSync("./scan_000864.jpg") // => true
}, function (err) {
console.log("Error occured: " + util.inspect(err));
});

}

process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
});

convertPDFTOJPG("./scan_000864.pdf");
`

In fact on this Armv8 machine if I enter the command "convert" with or without any arguments, I immediately get the following error:

convert: symbol lookup error: /usr/lib/libraqm.so.0: undefined symbol: fribidi_get_bracket_types

I suspect the problem is due to old Kernel or the Armv8 / Aarch64 Architecture. Unfortunately I am married to both these elements (Kernel version as well as the Architecture) so I cannot upgrade or change either one. Please advice what can I do to fix this.

@khaledhosny
Copy link

You need to update fribidi to version 1.0 or higher.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants