Skip to content

DMI metadata reading and injection #234

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Y0SH1M4S73R
Copy link

@Y0SH1M4S73R Y0SH1M4S73R commented Jul 16, 2025

This PR adds rustg_dmi_read_metadata to read metadata from a DMI, and rustg_dmi_inject_metadata to inject DMI metadata into a PNG-formatted file.

With rustg_dmi_inject_metadata, in conjunction with dmi_create_png's new support for alpha channels, it will now be possible to create arbitrary dmis from user-provided pixel data much faster than with BYOND's own icon operations.

Example Usage:

var/list/pixels = /* Some list containing 4096 rgba strings - 128 rows of 32 pixels, 32 rows per dir. */
rustg_dmi_create_png("output.dmi", "32", "128", pixels)
var/metadata = json_encode(list(\
  "width" = 32,\
  "height" = 32,\
  "states" = list(\
    list(\
      "name" = "",\
      "dirs" = 4,\
    )\
  )\
)
rustg_dmi_inject_metadata("output.dmi", metadata)

Copy link
Collaborator

@ZeWaka ZeWaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a bit strange to add a way to inject without an ability to read

@Y0SH1M4S73R
Copy link
Author

seems a bit strange to add a way to inject without an ability to read

Well if you want a DMI metadata reading function to go with it, I can do that.

@Y0SH1M4S73R Y0SH1M4S73R changed the title DMI metadata injection DMI metadata reading and injection Jul 19, 2025
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.

2 participants