fix(payload): calculates correct aspect ratio dimensions on sharp based files (#8537)

v2 PR [here](https://github.com/payloadcms/payload/pull/8510)
This commit is contained in:
Patrik
2024-10-08 14:45:51 -04:00
committed by GitHub
parent 9a0568c72e
commit c14c4298e2
3 changed files with 25 additions and 1 deletions

View File

@@ -141,6 +141,18 @@ describe('uploads', () => {
await saveDocAndAssert(page)
})
test('should properly create IOS file upload', async () => {
await page.goto(mediaURL.create)
await page.setInputFiles('input[type="file"]', path.resolve(dirname, './ios-image.jpeg'))
const filename = page.locator('.file-field__filename')
await expect(filename).toHaveValue('ios-image.jpeg')
await saveDocAndAssert(page)
})
test('should create animated file upload', async () => {
await page.goto(animatedTypeMediaURL.create)

BIN
test/uploads/ios-image.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB