feat: render .pxd thumbnails.#1430
Conversation
CyanVoxel
left a comment
There was a problem hiding this comment.
Functionally everything appears to work, though I have a couple nits for the documentation and a big nit for the categorization: Pixelmator is not a part of the iWork suite. iWork has always consisted only of Pages, Keynote, and Numbers. Pixelmator Pro has recently become a part of the Apple Creative Studio, which includes iWork apps along side their other professional grade software and miscellaneous apps like Freeform, but that does not retroactively make any of these part of the iWork suite.
I understand that the code for extracting an embedded thumbnail from a typical iWork file as well as a .pxd file is incredibly similar and seems to share many of the possible internal filenames, so I'd recommend renaming this class to something more generic like _apple_creative_suite_thumb() or _apple_embedded_thumb(). I know that typical iLife files don't have compatible structures with this, and can't speak for how the rest of the files in the creative suite operate, so it may be best to play it as generic as possible. For now I'd also just keep the .pxd extension in the _DOCUMENT_SET, I need to give these sets some attention and do an overall cleanup and reorganization.
Got it, I just put it there since Apple lists it alongside Pages and friends on the Pixelmator
Makes sense, I'll go with
Wouldn't that look something like this, grouping wise? elif (MediaCategories.is_ext_in_category(ext, MediaCategories.IWORK_TYPES)
or MediaCategories.is_ext_in_category(ext, MediaCategories.DOCUMENT_TYPES)):
image = self._apple_embedded_thumb(_filepath)It doesn't seem right, to treat all documents as potential apple formats. elif (MediaCategories.is_ext_in_category(ext, MediaCategories.IWORK_TYPES)
or MediaCategories.is_ext_in_category(ext, MediaCategories.APPLE_CREATIVE_STUDIO)):
image = self._apple_embedded_thumb(_filepath) |
|
For the check here you could either just use a check against the extension itself, similar to the PowerPoint one:
Since there's a growing dissonance between the media categories and what they're used for (e.g. searching for documents vs rendering document thumbnails) this'll be just fine for now. Eventually I'll rework the media types to better separate the groups depending on what they're used for |
Summary
Add support for rendering
.pxdthumbnails.Fixes #1409.
As mentioned in the issue,
.pxdfiles store their thumbnails in theQuickLookfolder, similar to the other iWork files, they just use.heicimages instead of.jpg.Preview.heicis checked beforeThumbnail.heicsince its resolution is a bit higher (2000x2000 instead of 1024x1024).Before
After
File used for testing
sample.pxd.txt from #1409.
Tasks Completed