Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTA04 on Wheezy can't open pdf files #1

Closed
Trim opened this issue Dec 13, 2013 · 3 comments
Closed

GTA04 on Wheezy can't open pdf files #1

Trim opened this issue Dec 13, 2013 · 3 comments

Comments

@Trim
Copy link

Trim commented Dec 13, 2013

Hello!

When you first run the application, Eyepiece ask you to install libdjvulibre21 and libfontconfig and install them without any issue in the apt log, but just after it says you "Installed Filed".

I've found a part of this issue: https://github.com/radekp/eyepiece/blob/static_cast/application/eyepiece.cpp#L100-L101 here Eyepiece check if /usr/lib/libdjvulibre.so.21 and /usr/lib/libfontconfig.so.1 exists and can't find it because of the multi-arch support of Wheezy.
Indeed, now the libraries are in: /usr/lib/arm-linux-gnueabihf/libdjvulibre.so.21 and /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1

To fix that, you can simply make symbolic links with ln -s.

Now the issue is that Eyepiece says "Error can't load plugins" when I try to load a PDF file with application/pdf mime type. I've read code of the load() plugin but it doesn't seem to have an issue: https://github.com/radekp/eyepiece/blob/static_cast/application/eyepiece.cpp#L381

I've only as output "/opt/qtmoko/bin" when I run Eyepiece from command line (with qpe.env environnement), so it means that the application give us only the first "qWarning()" call and not the second one.

I don't understand why, because I've installed the file package to check the mime type and it gives me: "application pdf ; charset=binary" and so I should get the second qWarning(). Maybe we should modify this condition to check substrings instead of check full string ?

@Trim
Copy link
Author

Trim commented Dec 14, 2013

Ok, I wasn't able to compile eyepiece with my QtMoko Wheezy SDK, but it seems that I've miss used the file command. Indeed the mime type was well "application/pdf" the other part is the mime encoding.

@Trim
Copy link
Author

Trim commented Dec 16, 2013

So, I was able to compile Eyepiece with more informations in debug messages and I've discovered that the mimetype of the document isn't discovered (the value of the contentID variable is empty and so this test fails). I'll check how this value should be initialized.

@Trim
Copy link
Author

Trim commented Dec 16, 2013

Ok, the error occurs only when we run Eyepiece from the command line with file as argument or when we use the Document viewer of QtMoko. If you load file directly from Eyepiece, you won't see this error.

So, to be able to use Eyepiece on QtMoko, we just need to apply a patch like this one:

@@ -97,8 +97,9 @@ Eyepiece::Eyepiece ( QWidget *parent, Qt::WFlags f ) :

 bool Eyepiece::libsFound()
 {
-    return QFile::exists("/usr/lib/libdjvulibre.so.21") &&
-                QFile::exists("/usr/lib/libfontconfig.so.1");
+    // First parenthesis for Squeeze, second one for multiarch in Wheezy
+    return  (QFile::exists("/usr/lib/libdjvulibre.so.21") && QFile::exists("/usr/lib/libfontconfig.so.1"))
+               || (QFile::exists("/usr/lib/arm-linux-gnueabihf/libdjvulibre.so.21") && QFile::exists("/usr/lib/arm-linux-gnueabihf/libfontconfig.so.1"));
 }

(You can cherry-pick my commit, it adds some debug informations too)

Or you can fix the bug with libraries symbolic links like reported in this bug report.

@Trim Trim closed this as completed May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant