foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
244 stars 9 forks source link

The `controlHash` option of `TextureExtractor` has no effect if `compression` is `NONE` #9327

Closed dev7355608 closed 1 month ago

dev7355608 commented 1 year ago

What happened?

controlHash isn't documented (nor the return value of extract). So maybe not a bug? But it would make sense if the control hash worked regardless of the compression mode.

What ways of accessing Foundry can you encounter this issue in?

Reproduction Steps

texture = PIXI.RenderTexture.create({ format: PIXI.FORMATS.RED, width: 1, height: 1 });
extractor = new TextureExtractor(canvas.app.renderer, { controlHash: true });
await extractor.extract({
    texture,
    compression: TextureExtractor.COMPRESSION_MODES.NONE
  });
pixels = await extractor.extract({
    texture,
    compression: TextureExtractor.COMPRESSION_MODES.NONE
});
console.assert(pixels === undefined); // fails

What core version are you reporting this for?

Version 11 (build 296)

Relevant log output

No response

Bug Checklist

aaclayton commented 1 year ago

We can make documentation changes - if desirable - during V11 stable maintenance. Otherwise we need to delay work on this until v12. Let's focus on the documentation part of the issue for now and create a follow-up issue for any other API changes that are necessary in the future.