fix: improve toutiao image uploads
This commit is contained in:
@@ -33,6 +33,14 @@ describe('media image helpers', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('can prefer jpeg conversion for platforms that reject large png uploads', () => {
|
||||
expect(buildAssetURLCandidates('/api/public/assets/12', { preferredFormat: 'jpg' })).toEqual([
|
||||
'http://127.0.0.1:8080/api/public/assets/12?format=jpg',
|
||||
'http://127.0.0.1:8080/api/desktop/content/assets/12?format=jpg',
|
||||
'http://127.0.0.1:8080/api/public/assets/12',
|
||||
])
|
||||
})
|
||||
|
||||
it('centers crop rectangles at the requested ratio', () => {
|
||||
const rect = getCenteredCropRect(1600, 1000, 4 / 3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user