Skip to content

[Bug]: createAsset and base64 images #5917

@Jmr3366

Description

@Jmr3366

Describe the Bug

The current implementation of createAsset uses a string variables in hopes to determine the image type.
When it comes to raw base64 images, this check fails.

You can't take a base64 encoded valid image string and use it with createAsset

To Reproduce

In a macro, do this:

[h: testB64 ="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+XnWQAAAAASUVORK5CYII="]
[r: asset = createAsset("baselineTest", testB64)]

This error is returned:
java.lang.NullPointerException: Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "java.net.URI.getScheme()" is null error executing expression asset = createAsset("baselineTest", testB64).

Expected Behaviour

I should be able to take any valid base64 image and use it with createAsset.

Screenshots

No response

MapTool Info

1.18.6

Desktop

Win 11

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions