Fix: thumbnail rendering aspect ratios and spreadsheet layouts
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m20s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m20s
This commit is contained in:
parent
8995b48eb5
commit
a87bb351d0
2 changed files with 13 additions and 1 deletions
|
|
@ -161,6 +161,18 @@ func generateOfficeThumbnail(filePath, destPath string, cfg *config.Config) erro
|
||||||
"outputtype": "jpg",
|
"outputtype": "jpg",
|
||||||
"title": "preview.jpg",
|
"title": "preview.jpg",
|
||||||
"url": fileUrl,
|
"url": fileUrl,
|
||||||
|
"thumbnail": map[string]interface{}{
|
||||||
|
"aspect": 0,
|
||||||
|
"first": true,
|
||||||
|
"width": 1024,
|
||||||
|
"height": 1024,
|
||||||
|
},
|
||||||
|
"spreadsheetLayout": map[string]interface{}{
|
||||||
|
"ignorePrintArea": true,
|
||||||
|
"printGridlines": true,
|
||||||
|
"printHeadings": true,
|
||||||
|
"fitToWidth": 1,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
payloadBytes, err := json.Marshal(payload)
|
payloadBytes, err := json.Marshal(payload)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export default function ThumbnailImage({ checksum, fallbackIcon, downloadToken }
|
||||||
key={key}
|
key={key}
|
||||||
src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''}
|
src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''}
|
||||||
alt=""
|
alt=""
|
||||||
className="w-full h-full object-cover"
|
className="w-full h-full object-contain"
|
||||||
style={{ display: showFallback ? 'none' : 'block' }}
|
style={{ display: showFallback ? 'none' : 'block' }}
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
if (errorCount < 5) {
|
if (errorCount < 5) {
|
||||||
|
|
|
||||||
Reference in a new issue