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

Linux: some image assets missing from appimage build #155

Closed
cibomahto opened this issue Nov 21, 2016 · 6 comments
Closed

Linux: some image assets missing from appimage build #155

cibomahto opened this issue Nov 21, 2016 · 6 comments
Labels

Comments

@cibomahto
Copy link
Member

cibomahto commented Nov 21, 2016

The Welcome Screen images are missing from the linux app image:
virtualbox_linux mint 17 mate_21_11_2016_11_22_15
For reference, this is what it should look like:
screen shot 2016-11-21 at 11 23 16 am

@probonopd
Copy link
Contributor

Should be a matter of copying the assets to the correct place... let me know if you'd like help from my side on this.

@probonopd
Copy link
Contributor

How do you call these images in the code, in other words, where are they expected to be loaded from?

@cibomahto
Copy link
Member Author

They are loaded from QUrl addresses during runtime, like this:

https://github.com/Blinkinlabs/PatternPaint/blob/master/PatternPaint/gui/scenetemplate.cpp
SceneTemplate sceneTemplates[SCENE_TEMPLATE_COUNT] = {
{
"BlinkyTape",
":/scenetemplates/images/scenetemplates/blinkytape.jpg",
":/examples/blinkytape",
"BlinkyTape",
"Linear",
RGB,
60,
1
},

https://github.com/Blinkinlabs/PatternPaint/blob/master/PatternPaint/gui/welcomescreen.cpp
for (int i = 0; i < SCENE_TEMPLATE_COUNT; i++) {
QListWidgetItem *item = new QListWidgetItem(sceneTemplates[i].name, ui->SceneList);
item->setIcon(QIcon(sceneTemplates[i].photo));
}

and they are listed in a qrc file:
https://github.com/Blinkinlabs/PatternPaint/blob/master/PatternPaint/images.qrc
https://github.com/Blinkinlabs/PatternPaint/tree/master/PatternPaint/images/scenetemplates

@probonopd
Copy link
Contributor

probonopd commented Dec 4, 2016

The : in the example above means that QDir::searchPaths is used.

The images are part of the AppImage, e.g., in images/scenetemplates/blinkytape.jpg. The way I read https://github.com/Blinkinlabs/PatternPaint/tree/master/PatternPaint/images/scenetemplates this sould be correct... but running strace shows something suspicious:

[pid  3453] open("/tmp/.mount_knewpk/plugins/platforms/../../lib/libxcb-image.so.0", O_RDONLY|O_CLOEXEC <unfinished ...>
[pid  3453] stat("/tmp/.mount_knewpk/plugins/imageformats/.",  <unfinished ...>

Looks like plugins/imageformats/* needs to be deployed but isn't. Opened an issue with linuxdeployqt:
probonopd/linuxdeployqt#53

@cibomahto
Copy link
Member Author

I expected them to be embedded in the executable, as that's how they are built on Windows and macOs. Following:
https://doc.qt.io/qt-5/resources.html

I can see that they are pulled into a temp file 'qrc_images.cpp', at least during a normal qmake build on our internal CI server. It's a little interesting that the program icons and other resources should be using the same loading method, but seem to be present in the build.

@probonopd
Copy link
Contributor

probonopd commented Dec 4, 2016

I can confirm that I have identified the root cause and fixed it in probonopd/linuxdeployqt@4951fd1 (an else was missing there).

Here is a working AppImage:
https://transfer.sh/JMRDB/patternpaint-git2.0.4-50-g6754f12-x86-64.appimage
Build log:
https://travis-ci.org/probonopd/PatternPaint#L1163

I will send a PR once some cleanup on my side is done.

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

No branches or pull requests

2 participants