Skip to content

Consider the content of inline pictures as base64 or as file name #10

@phbernard

Description

@phbernard

Currently, the lib is expecting a file name as the content when the type is inline:

master_picture: {
    type: 'inline',
    content: 'some_file.png'
}

This is counter-intuitive. The two relevant syntax should be:

File name:

master_picture: {
    content: 'some_file.png'
}

Base 64:

master_picture: {
    type: 'inline',
    content: 'U29tZSByYW5kb20gY29udGVudA=='
}

However, the current behavior is explicitly tested (https://github.com/RealFaviconGenerator/rfg-api/blob/master/test/test.js#L292). It must be safer to accept both types of content, even if this is not pretty:

master_picture: {
    type: 'inline',
    content: 'some_file.png'
}

and:

master_picture: {
    type: 'inline',
    content: 'U29tZSByYW5kb20gY29udGVudA=='
}

This issue is related to RealFaviconGenerator/realfavicongenerator#236

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions