question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SpritesheetLoader - (multi-pack) metadata used only for first image

See original GitHub issue

Hi,

I think I’ve found a bug, the problem occurs when we are loading sprite sheets that use the multi-pack feature and we provide “metadata” in loader options.

The problem is that “metadata” is used only when loading the first sprite sheet, it is not passed to rest spritesheets, so for example when we are specifying baseTexture options (imageMetadata), those options are used only in first texture.

In my opinion, “metadata” should be shared across all sprite sheets in multi-pack.

Expected Behavior

“metadata” should be passed to rest sprite sheets.

Current Behavior

“metadata” is not passed to rest sprite sheets.

Possible Solution

pass metadata when adding rest multi-pack sprite sheets to the loader.

https://github.com/pixijs/pixijs/blob/dev/packages/spritesheet/src/SpritesheetLoader.ts (line 80)

const options = {
    crossOrigin: resource.crossOrigin,
    loadType: LoaderResource.LOAD_TYPE.XHR,
    xhrType: LoaderResource.XHR_RESPONSE_TYPE.JSON,
    parentResource: resource,
    metadata: resource.metadata
};

Steps to Reproduce

https://codesandbox.io/s/pixi-spritesheetloader-metadata-rul1b

Environment

  • pixi.js version: 6.1.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Gawlascommented, Aug 18, 2021

I meant metadata passed in the loader options, not metadata inside sprite sheet (json file), for example, “imageMetadata” which is used to specify baseTexture options

loader.add("spritesheet.json", {metadata: {key: value}})

0reactions
Gawlascommented, Aug 24, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Texture Atlas Settings - CodeAndWeb
This chapter describes the options used for packing your sprite sheets. The options are available from command line and from the graphical user...
Read more >
Image Information and Metadata | Google Earth Engine
Print image objects to explore band names, projection information, properties, and other metadata. The following examples demonstrate ...
Read more >
Metadata basics and actions in Lightroom Classic
Learn about Adobe Photoshop Lightroom Classic metadata (information about a photo, such as author name, resolution, color space, copyright, ...
Read more >
Photo Metadata User Guide - IPTC
This document is designed to familiarise photographers, photo editors and metadata managers with the use of the IPTC Photo Metadata Standard.
Read more >
What is Metadata and how to customize it for Social Media
LinkedIn, and Pinterest only make use of Title and Main Image. Modifying Metadata Only for Social Media. If you want to modify the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found