Skip to content

Support Illustrations scale (dpr), height and width #937

@rgaudin

Description

@rgaudin

While developing libzim7, we updated the spec to introduce Illustrations which are metadata for which dimensions and scale are stored as part of the metadata entry path.

We decided then that we wanted to store a scale so applications dont have to re-implement this on their own.

Unfortunately, to cut some corners and reach the release, we decided that libzim implementation will be deferred as the urgent need what supporting the favicon scenario through illustrations and that required a single size and scale.

To this day, it is still not possible to neither store nor retrieve an illustration at a scale other than 1 (~~ via the Illustration API)

void Creator::addIllustration(unsigned int size, std::unique_ptr<ContentProvider> provider)
{
checkError();
addMetadata(Formatter() << "Illustration_" << size << "x" << size << "@1",
std::move(provider), "image/png");

libzim/src/archive.cpp

Lines 157 to 159 in cdcbb6c

Item Archive::getIllustrationItem(unsigned int size) const {
auto r = m_impl->findx('M', Formatter() << "Illustration_" << size << "x"
<< size << "@" << 1);

I would now want to see this implemented.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions