Open superbonaci opened 1 year ago
Emmm...QuickLook API design (from Apple) does not support Animated Image.
You see, it's received a CGContext
(canvas, only draw one image), or CGImage
(single frame)
We can only support to display animated AVIF into the static poster frame, is this enough for your use case ? @superbonaci
For Preview (Space):
For Icon Thumbnail (See in Finder):
Emmm...QuickLook API design (from Apple) does not support Animated Image.
I can play perfectly animated gif inside Quick Look (select the gif then Space Bar), for example this file: https://giphy.com/gifs/tag-sample-BfbUe877N4xsUhpcPc
If I click the "Open with Preview" button then it displays a static image, but that's not what I meant.
You don't realize that GIF
is Apple's internal QuickLook Plugin, which does not use the public API.
As a non-Apple company employee, I can not do the similiar thing, because the public API does not contains this ability.
qlmanage -m plugins
qlmanage -p example.avif
Check the verbose log, which point into this `/System/Library/QuickLook/Image.qlgenerator`
If possible, I can try to dis-assemble that Apple's Image.qlgenerator
and see how they render Animation on CGContext. Maybe using a Timer to refresh the canvas ?
Or find their private API, which may contains something like frame count, duration, etc
Maybe the old generator based can not support animation. The new QLPreviewView (Which need a App, no longer a qlgenerator
plugin) can custom draw anything on NSView
https://developer.apple.com/videos/play/wwdc2019/719?time=942 https://developer.apple.com/documentation/quicklookui/qlpreviewview https://developer.apple.com/documentation/quicklook/qlpreviewingcontroller?language=objc
Maybe this is the future way to support animation.
You don't realize that
GIF
is Apple's internal QuickLook Plugin, which does not use the public API.
You mean that GIF
is AN internal QuickLook Plugin, not the only one. The video you quoted talks about thumbnails, just hope your app doesn't create such files. Viewing or previewing any file should not create any new file or "cache" in the filesystem.
I wonder if you can make this work as a "plugin" and not having to install a full .dmg program.
Maybe it's just a AVIFQuickLook.app
, you can place it into anywhere you like (Because Mac has a Spotlight service, will search all .app
in your disk), like ~/Documents/Tools/AVIFQuickLook.app
, you don't need to open it at all.
Then you can preview the AVIFs animation.
File sequence-without-pitm.avif from this bug is animated: AVIF (AV1 Image File Format): image sequence and animation support
But animation is not played by AVIFQuickLook, only static image. Google Chrome does play it.