@@ -1295,11 +1295,12 @@ def _model_stl_thumb(filepath: Path, size: int) -> Image.Image | None: # pyrigh
12951295 return im
12961296
12971297 @staticmethod
1298- def _pdf_thumb (filepath : Path , size : int ) -> Image .Image | None :
1299- """Render a thumbnail for a PDF file.
1298+ def _pdf_thumb (filepath : Path , size : int , ext : str ) -> Image .Image | None :
1299+ """Render a thumbnail for a PDF or Adobe Illustator file.
13001300
13011301 filepath (Path): The path of the file.
13021302 size (int): The size of the icon.
1303+ ext (str): The file extension.
13031304 """
13041305 im : Image .Image | None = None
13051306
@@ -1321,7 +1322,7 @@ def _pdf_thumb(filepath: Path, size: int) -> Image.Image | None:
13211322 else :
13221323 page_size *= size / page_size .width ()
13231324 # Enlarge image for anti-aliasing
1324- scale_factor = 2.5
1325+ scale_factor = 2.5 if ext in { ".pdf" } else 1
13251326 page_size *= scale_factor
13261327 # Render image with no anti-aliasing for speed
13271328 render_options : QPdfDocumentRenderOptions = QPdfDocumentRenderOptions ()
@@ -1910,7 +1911,7 @@ def _render(
19101911 elif MediaCategories .is_ext_in_category (
19111912 ext , MediaCategories .PDF_TYPES , mime_fallback = True
19121913 ):
1913- image = self ._pdf_thumb (_filepath , adj_size )
1914+ image = self ._pdf_thumb (_filepath , adj_size , ext )
19141915 # Archives =====================================================
19151916 elif MediaCategories .is_ext_in_category (ext , MediaCategories .ARCHIVE_TYPES ):
19161917 image = self ._archive_thumb (_filepath , ext )
0 commit comments