assetpack icon indicating copy to clipboard operation
assetpack copied to clipboard

Bug: bitmap font texture is scaled to 0.5 after exporting in version 1.3.0

Open hotyes opened this issue 1 year ago • 8 comments

After upgrade assetpack to 1.3.0 the bitmap font is broken

Image

but it is working on assetpack 1.2.3

Image

I used {fix} as the tags

hotyes avatar Jan 30 '25 14:01 hotyes

Hey @hotyes can you share with me your assetpack config?

Zyie avatar Jan 30 '25 14:01 Zyie

@Zyie yes sure

.assetpack.js

import { pixiPipes } from '@assetpack/core/pixi'
import { webfont } from '@assetpack/core/webfont'
import { json } from '@assetpack/core/json'

export default {
    entry: './raw-assets',
    output: './public/assets/',
    cache: false,
    compression: true,
    pipes: [
        ...pixiPipes({
            cacheBust: false,
            resolutions: { high: 2, default: 1, low: 0.5 },
            texturePacker: {
                texturePacker: {
                    removeFileExtension: true,
                },
            },
            manifest: {
                trimExtensions: true,
                output: './public/assets/assets-manifest.json',
            },
        }),
    ],
}

Image

hotyes avatar Jan 30 '25 15:01 hotyes

Thank you!

I think I know what has happened here, can you try out this config and tell me if it fixes the issue:

import { audio } from '@assetpack/core/ffmpeg';
import { compress, mipmap } from '@assetpack/core/image';
import { json } from '@assetpack/core/json';
import { pixiManifest } from '@assetpack/core/manifest';
import { spineAtlasCompress, spineAtlasManifestMod, spineAtlasMipmap } from '@assetpack/core/spine';
import { texturePacker, texturePackerCompress } from '@assetpack/core/texture-packer';
import { webfont } from '@assetpack/core/webfont';

const manifestOptions = {
    createShortcuts: true,
    trimExtensions: true,
    output: './public/assets/assets-manifest.json',
};

export default {
    entry: './raw-assets',
    output: './public/assets/',
    cache: false,
    pipes: [
        webfont(),
        audio(),
        texturePacker({
            texturePacker: {
                removeFileExtension: true,
            },
            resolutionOptions: {
                fixedResolution: 'default',
                resolutions: { high: 2, default: 1, low: 0.5 },
            },
        }),
        mipmap({
            fixedResolution: 'high',
            resolutions: { high: 2, default: 1, low: 0.5 },
        }),
        spineAtlasMipmap({
            fixedResolution: 'default',
            resolutions: { high: 2, default: 1, low: 0.5 },
        }),
        compress(),
        spineAtlasCompress(),
        texturePackerCompress(),
        json(),
        pixiManifest(manifestOptions),
        spineAtlasManifestMod(manifestOptions),
    ],
};

Zyie avatar Jan 30 '25 15:01 Zyie

hi @Zyie unfortunately it is not working and I got this error now:

Uncaught (in promise) Error: [Loader.load] Failed to load http://localhost:5173/assets/game/numbers/numbers.xml.
Error: [Loader.load] Failed to load http://localhost:5173/assets/game/numbers/numbers.png.
InvalidStateError: The source image could not be decoded.

and my other textures also scaled

hotyes avatar Jan 30 '25 16:01 hotyes

unfortunately it is not working and I got this error now:

hmm ok, i'll dig into this further. it definitely this PR that caused this to happen: #96

Zyie avatar Jan 30 '25 16:01 Zyie

ok thanks

hotyes avatar Jan 30 '25 16:01 hotyes

Hey @hotyes

After looking into this one a bit more we have now introduced the {nomip} tag in 1.4.0. If you could replace the {fix} tag with this one it should solve your problem! If not let me know and i'll have another go at this

Zyie avatar Feb 06 '25 11:02 Zyie

hi @Zyie thanks for this..

after upgrading to 1.4.0 whether using {nomip} or {fix}, it solved solved my problem, not sure if this is expected ?

hotyes avatar Feb 07 '25 21:02 hotyes