Resize mesh based on texture size

You can calculate the ratio and then apply it as a box scale, something like:

const boxSize = 1.0; // This can be any number
const ratio = texture.height / texture.width;

object.scale.set(boxSize, boxSize * ratio, 1.0) // x - width; y - height; z - you can just as well ignore it

Since size in 3D is relative to the camera transformation and perspective, using texture resolution values won’t help much, besides calculating this ratio (if you’d want the textured box to take up the entire screen, this may help though.)