fix(test): fix CRC error in png samples
This commit is contained in:
@@ -427,9 +427,18 @@ export const SAMPLE_FILES = {
|
|||||||
png: (): SeedFile => ({
|
png: (): SeedFile => ({
|
||||||
name: 'pixel.png',
|
name: 'pixel.png',
|
||||||
mimeType: 'image/png',
|
mimeType: 'image/png',
|
||||||
// 1×1 transparent PNG.
|
// 1×1 transparent RGBA PNG. Regenerate with:
|
||||||
|
// python3 -c "import struct,zlib,base64; \
|
||||||
|
// c=lambda t,d: struct.pack('>I',len(d))+t+d+struct.pack('>I',zlib.crc32(t+d)); \
|
||||||
|
// p=b'\x89PNG\r\n\x1a\n' + c(b'IHDR',struct.pack('>IIBBBBB',1,1,8,6,0,0,0)) \
|
||||||
|
// + c(b'IDAT',zlib.compress(b'\x00\x00\x00\x00\x00')) + c(b'IEND',b''); \
|
||||||
|
// print(base64.b64encode(p).decode())"
|
||||||
|
// The `image` crate rejects malformed IDAT CRCs even where ImageMagick's
|
||||||
|
// `identify` (without `-verbose`) stays silent, so the fixture must be
|
||||||
|
// strictly valid — an earlier drop-in from the wild had a corrupt IDAT
|
||||||
|
// CRC that broke every server-side thumbnail generation off this pixel.
|
||||||
body: Buffer.from(
|
body: Buffer.from(
|
||||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
|
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR4nGNgAAIAAAUAAXpeqz8AAAAASUVORK5CYII=',
|
||||||
'base64',
|
'base64',
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -148,8 +148,10 @@ test('add an audio track and drive the player', async ({ page }) => {
|
|||||||
.setInputFiles({
|
.setInputFiles({
|
||||||
name: 'cover.png',
|
name: 'cover.png',
|
||||||
mimeType: 'image/png',
|
mimeType: 'image/png',
|
||||||
|
// 1×1 transparent RGBA PNG with valid CRCs — see the regenerate
|
||||||
|
// snippet in spa/helpers.ts under SAMPLE_FILES.png.
|
||||||
buffer: Buffer.from(
|
buffer: Buffer.from(
|
||||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
|
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR4nGNgAAIAAAUAAXpeqz8AAAAASUVORK5CYII=',
|
||||||
'base64',
|
'base64',
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ test('open the avatar edit panel and upload an image', async ({ page }) => {
|
|||||||
name: 'avatar.png',
|
name: 'avatar.png',
|
||||||
mimeType: 'image/png',
|
mimeType: 'image/png',
|
||||||
buffer: Buffer.from(
|
buffer: Buffer.from(
|
||||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
|
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR4nGNgAAIAAAUAAXpeqz8AAAAASUVORK5CYII=',
|
||||||
'base64',
|
'base64',
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user