Skip to content

Commit

Permalink
Merge branch 'feat/data-tags' into feat/texture-packer-names
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie authored Sep 3, 2024
2 parents 68e6716 + d96eee4 commit 65bb857
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/assetpack/src/image/compress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export function compress(options: CompressOptions = {}): AssetPipe<CompressOptio
if ((image.format === '.png' && !options.png) || (((image.format === '.jpg') || (image.format === '.jpeg')) && !options.jpg))
{
newAssets.push(asset);

}

return newAssets;
}
catch (error)
Expand Down
6 changes: 3 additions & 3 deletions packages/assetpack/src/image/utils/compressGpuTextures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export async function compressGpuTextures(
options: CompressOptions,
): Promise<CompressImageDataResult[]>
{
let compressed: CompressImageDataResult[] = [];
let compressed: (Partial<CompressImageDataResult> & {image: Promise<string>})[] = [];

if (!options.astc && !options.bc7 && !options.basis)
{
return compressed;
return compressed as CompressImageDataResult[];
}

const tmpDir = await fs.mkdtemp(join(tmpdir(), 'assetpack-tex-'));
Expand Down Expand Up @@ -87,7 +87,7 @@ export async function compressGpuTextures(
await fs.rm(tmpDir, { recursive: true, force: true });
}

return compressed;
return compressed as CompressImageDataResult[];
}

async function adjustImageSize(sharpImage: sharp.Sharp, imagePath: string): Promise<string>
Expand Down
1 change: 1 addition & 0 deletions packages/assetpack/test/spine/spineAtlasAll.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ describe('Spine Atlas All', () =>
// remove the outputDir
file = file.replace(`${outputDir}/`, '');
const isFileHalfSize = file.includes('@0.5x');
// eslint-disable-next-line no-nested-ternary
const isFileFileType = file.includes(isWebp ? '.webp' : isAstc ? '.astc' : '.png');
const shouldExist = isHalfSize === isFileHalfSize && isFileType === isFileFileType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ describe('Texture Packer All', () =>
// remove the outputDir
file = file.replace(`${outputDir}/`, '');
const isFileHalfSize = file.includes('@0.5x');
// eslint-disable-next-line no-nested-ternary
const isFileFileType = file.includes(isWebp ? '.webp' : isAstc ? '.astc.ktx' : '.png');
const shouldExist = isHalfSize === isFileHalfSize && isFileType === isFileFileType;

Expand Down

0 comments on commit 65bb857

Please sign in to comment.