Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/ArchiveImageProvider.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 57 | { | |||
---|---|---|---|---|---|
59 | Q_UNUSED(requestedSize) | 59 | Q_UNUSED(requestedSize) | ||
60 | QImage img; | 60 | QImage img; | ||
61 | bool success = false; | 61 | bool success = false; | ||
62 | 62 | | |||
63 | /* | 63 | /* | ||
64 | * In ACBF, image references starting with a '#' refer to files embedded | 64 | * In ACBF, image references starting with a '#' refer to files embedded | ||
65 | * in the <data> section of the .acbf file. | 65 | * in the <data> section of the .acbf file. | ||
66 | * see: http://acbf.wikia.com/wiki/Body_Section_Definition#Image | 66 | * see: http://acbf.wikia.com/wiki/Body_Section_Definition#Image | ||
67 | * TODO: binary files can also handle fonts, and those cannot be loaded into a QImage. | ||||
leinir: the loadFromData function sort of already handles that, but yes, might make sense to add a… | |||||
67 | */ | 68 | */ | ||
68 | if (id.startsWith('#')) { | 69 | if (id.startsWith('#')) { | ||
69 | auto document = qobject_cast<AdvancedComicBookFormat::Document*>(d->bookModel->acbfData()); | 70 | auto document = qobject_cast<AdvancedComicBookFormat::Document*>(d->bookModel->acbfData()); | ||
70 | 71 | | |||
71 | if (document) { | 72 | if (document) { | ||
72 | AdvancedComicBookFormat::Binary* binary = document->data()->binary(id.mid(1)); | 73 | AdvancedComicBookFormat::Binary* binary = document->data()->binary(id.mid(1)); | ||
73 | 74 | | |||
74 | if (binary) { | 75 | if (binary) { | ||
Show All 36 Lines |
the loadFromData function sort of already handles that, but yes, might make sense to add a check to ensure what it's trying to load is image data :)