mirror of
https://github.com/Damillora/phoebe.git
synced 2025-03-10 05:57:22 +00:00
fix: incorrect resize logic when generating preview and thumbnails
This commit is contained in:
parent
fa74ef85b6
commit
af30246132
@ -119,12 +119,14 @@ func uploadBlob(c *gin.Context) {
|
|||||||
previewFactor := float32(previewWidth) / float32(width)
|
previewFactor := float32(previewWidth) / float32(width)
|
||||||
previewHeight := int(float32(height) * previewFactor)
|
previewHeight := int(float32(height) * previewFactor)
|
||||||
if width <= previewWidth {
|
if width <= previewWidth {
|
||||||
|
previewWidth = width
|
||||||
previewHeight = height
|
previewHeight = height
|
||||||
}
|
}
|
||||||
thumbnailWidth := 300
|
thumbnailWidth := 300
|
||||||
thumbnailFactor := float32(thumbnailWidth) / float32(width)
|
thumbnailFactor := float32(thumbnailWidth) / float32(width)
|
||||||
thumbnailHeight := int(float32(height) * thumbnailFactor)
|
thumbnailHeight := int(float32(height) * thumbnailFactor)
|
||||||
if width <= thumbnailWidth {
|
if width <= thumbnailWidth {
|
||||||
|
thumbnailWidth = width
|
||||||
thumbnailHeight = height
|
thumbnailHeight = height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user