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

New function createAsset #4923

Merged
merged 14 commits into from
Oct 16, 2024
Merged

Conversation

Jmr3366
Copy link
Contributor

@Jmr3366 Jmr3366 commented Sep 15, 2024

Description of the Change

New trusted macro function createAsset(name,imageData) that will return an asset:\\< asset ID > value on success.
Checks are made for data types and only webp,jpg,png are permitted data types.

Possible Drawbacks

  • createAsset can allow scriptable asset creation and if implemented improperly, could be campaign breaking.
    With great power comes great responsibility.

Release Notes

Examples:
[r: createAsset("Test", < base64 encoded image data >)]
[r: createAsset("Test", "https://website.com/image.webp")]
outputs
asset:\\< asset ID >

(I renamed my branch as I almost overwrote it)


This change is Reviewable

@cwisniew
Copy link
Member

cwisniew commented Oct 9, 2024

This needs to ensure the asset is valid before adding it to the campaign

@Jmr3366
Copy link
Contributor Author

Jmr3366 commented Oct 10, 2024

I do check file headers for the 3 file formats this function supports. If there are other checks I can do or add, I will try to comply with those.

@Jmr3366 Jmr3366 requested a review from cwisniew October 12, 2024 11:28
@cwisniew cwisniew added this pull request to the merge queue Oct 16, 2024
Merged via the queue into RPTools:develop with commit 2cd1d38 Oct 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import Base64-encoded image data to Asset
2 participants