diff --git a/backend/workers/thumbnails.go b/backend/workers/thumbnails.go index d26ca4b..9cee374 100644 --- a/backend/workers/thumbnails.go +++ b/backend/workers/thumbnails.go @@ -148,7 +148,7 @@ func (m *ThumbnailManager) worker(id int) { err = generateVideoThumbnail(fullSourcePath, destPath) } else if strings.HasPrefix(job.MimeType, "audio/") { err = generateAudioThumbnail(fullSourcePath, destPath) - } else if strings.HasSuffix(job.FilePath, ".docx") || strings.HasSuffix(job.FilePath, ".pptx") || strings.HasSuffix(job.FilePath, ".xlsx") { + } else if strings.HasSuffix(strings.ToLower(job.FilePath), ".pdf") || strings.HasSuffix(strings.ToLower(job.FilePath), ".docx") || strings.HasSuffix(strings.ToLower(job.FilePath), ".pptx") || strings.HasSuffix(strings.ToLower(job.FilePath), ".xlsx") { err = generateOfficeThumbnail(job.FilePath, destPath, m.Config) } else { continue diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index 40dde0c..3dc1678 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -1240,7 +1240,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { })(); if (isMedia && file.checksum && viewMode === 'grid') { - const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : file.name.endsWith('.pdf') ? 'pdf' : null; + const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : ext === 'pdf' ? 'pdf' : null; // Use fallbackIcon for PDF too so it shows "PDF" text while loading const currentFallback = ext === 'pdf' ? (
diff --git a/frontend/src/components/ThumbnailImage.tsx b/frontend/src/components/ThumbnailImage.tsx index b2782fb..ae97ec8 100644 --- a/frontend/src/components/ThumbnailImage.tsx +++ b/frontend/src/components/ThumbnailImage.tsx @@ -34,10 +34,10 @@ export default function ThumbnailImage({ checksum, fallbackIcon, downloadToken, key={key} src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''} alt="" - className={`object-contain ${ + className={`${ docType === 'pdf' ? 'w-full h-full object-cover object-top' : docType ? 'w-full h-full object-cover mix-blend-multiply' : - 'w-full h-full' + 'object-contain w-full h-full' }`} style={{ display: showFallback ? 'none' : 'block' }} onError={(e) => {