Restore automatic output size that matches the input still.
Keep 16:9, 9:16, and square as overrides, but default aspect back to Auto so MiniMax follows the source image. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -85,10 +85,14 @@ function jpegSize(buf: Buffer) {
|
||||
return null
|
||||
}
|
||||
|
||||
export function resolveOutputSize(aspect: string | undefined, _image: Buffer, fallbackWidth?: number, fallbackHeight?: number) {
|
||||
export function resolveOutputSize(aspect: string | undefined, image: Buffer, fallbackWidth?: number, fallbackHeight?: number) {
|
||||
if (aspect && ASPECT_PRESETS[aspect]) {
|
||||
return ASPECT_PRESETS[aspect]
|
||||
}
|
||||
const size = imageDimensions(image)
|
||||
if (size?.width && size?.height) {
|
||||
return autoResolution(size.width, size.height)
|
||||
}
|
||||
if (Number(fallbackWidth) && Number(fallbackHeight)) {
|
||||
return { width: snap32(Number(fallbackWidth)), height: snap32(Number(fallbackHeight)) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user