Nyx0uf / qlImageSize

QuickLook and Spotlight plugins to display the dimensions, size and DPI of an image in the title bar instead of the filename. Also preview some unsupported formats like WebP & bpg.
MIT License
1.19k stars 66 forks source link

macOS 10.15+ Support #45

Open manngo opened 5 years ago

manngo commented 5 years ago

I have tried this on two machines with a freshly install MacOS 10.15 Catalina. It doesn’t appear to be working.

Nyx0uf commented 5 years ago

I don't plan on installing catalina any time soon, so either someone find the cause why it's not working or you'll have to wait.

manngo commented 5 years ago

As far as I can tell, it must be a 32bit application which no longer works in Catalina. I don’t know whether it would be a matter of recompiling.

Nyx0uf commented 5 years ago

Nonsense, this plugin has been 64-bit only since the beginning.

jeffbyrnes commented 5 years ago

This issue is that this and other QL plugins are no longer recognized as created by an identified developer due to notarization enforcement. The binary needs to be notarized by Apple, which needs a Developer Apple ID and Xcode.

Here are the docs on Notarizing Your App Before Distribution.

Nyx0uf commented 5 years ago

I don't want to waste the little time I have with this kind of bullshit. With 900+ stars & 50 forks on this repo it should not be too hard to find someone to do it.

rurza commented 5 years ago

I don't want to waste the little time I have with this kind of bullshit. With 900+ stars & 50 forks on this repo it should not be too hard to find someone to do it.

Then it will require the pull request every time you want to release a new version.

sbarex commented 5 years ago

Has anyone tried to see if it works on 10.15.1? I updated my virtual machine and it seems that now the various qlgenerators works but I'm not sure if I did something strange in the settings or if it's a problem solved in the last update.

setanarut commented 5 years ago

The title bar does not provide information except these two formats; WebP, BPG macOS Catalina 10.15.1

sbarex commented 5 years ago

I think that macos don't allow to customize the quicklook for some common file formats like jpg, png… so for these files is used the standard generator, for less common format (like webp) is used the custom generator.

setanarut commented 5 years ago

I think that macos don't allow to customize the quicklook for some common file formats like jpg, png… so for these files is used the standard generator, for less common format (like webp) is used the custom generator.

duplicate https://github.com/Nyx0uf/qlImageSize/issues/44

setanarut commented 5 years ago

The system prefers the public.image identifier.

/System/Library/QuickLook/Image.qlgenerator/Contents/Info.plist

<key>CFBundleTypeRole</key>
            <string>QLGenerator</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.image</string>
            </array>
RomanSmolka commented 5 years ago

The system prefers the public.image identifier.

/System/Library/QuickLook/Image.qlgenerator/Contents/Info.plist

<key>CFBundleTypeRole</key>
            <string>QLGenerator</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.image</string>
            </array>

I just tried moving /System/Library/QuickLook/Image.qlgenerator somewhere else to see if it makes any difference. To my surprise, quick looking images still works the same. Looks like ql for images works somewhat different in Catalina...

manngo commented 5 years ago

The system prefers the public.image identifier. /System/Library/QuickLook/Image.qlgenerator/Contents/Info.plist

<key>CFBundleTypeRole</key>
            <string>QLGenerator</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.image</string>
            </array>

I just tried moving /System/Library/QuickLook/Image.qlgenerator somewhere else to see if it makes any difference. To my surprise, quick looking images still works the same. Looks like ql for images works somewhat different in Catalina...

How did you move it? I tried it myself and the system won’t let me.

RomanSmolka commented 5 years ago

How did you move it? I tried it myself and the system won’t let me.

You need to re-mount the system partition as writable with sudo mount -uw /. Then use mv with sudo.

manngo commented 5 years ago

Ah. I forgot about about the new partitioning system for Catalina.

setanarut commented 5 years ago

@RomanSmolka I wonder if changing the file extension will give the same result. maybe changing the file location is ineffective. you can back up the file by compressing it. if the generator is not used. why there? interesting.

sbarex commented 5 years ago

I just tried moving /System/Library/QuickLook/Image.qlgenerator somewhere else to see if it makes any difference. To my surprise, quick looking images still works the same. Looks like ql for images works somewhat different in Catalina...

after moving the generator do you have reset quicklook with qlmanage -r? and after try to view an image that you don't have opened recenty to be sure it's not in the cache.

RomanSmolka commented 5 years ago

after moving the generator do you have reset quicklook with qlmanage -r? and after try to view an image that you don't have opened recenty to be sure it's not in the cache.

Yes, it's still the same even after reboot.

skynet01 commented 5 years ago

So what you are saying is that you can make this extension work by deleting the default image preview in Catalina? Do you still have the new Catalina controls like the rotate and markup button?

setanarut commented 5 years ago

Someone who understands Catalina should write a new plugin. All we need is to show the title bar information. WebP is not required. the system's own generator should be used. I lost a feature that was very useful to me and loved.

skynet01 commented 5 years ago

I think someone can just fork the current one and fix it. :)

RomanSmolka commented 5 years ago

@skynet01 No, that doesn't make it work. There is actually no difference whether the image generator is present or not, which leads me to a thought that in Catalina, image QL is not generated by an extension. Maybe they did it to support the new features you mentioned. But I might be wrong.

hamiltont commented 4 years ago

Regarding this:

This issue is that this and other QL plugins are no longer recognized as created by an identified developer due to notarization enforcement. The binary needs to be notarized by Apple, which needs a Developer Apple ID and Xcode.

You can disable gatekeeper by opening a terminal and running this. After doing this, qlImage runs OK on Catalina for webp files (the system generator is still used for all other image types)

$ xattr -d -r com.apple.quarantine ~/Library/QuickLook/qlImageSize.qlgenerator/

As an FYI, homebrew-cask team is currently frustrated by gatekeeper on Catalina, it's breaking many useful-but-small-audience utilities. See https://github.com/Homebrew/homebrew-cask/issues/70798 for a more in depth discussion.

I did try to debug the public.image issue, got as far as this line but it still seems to render preview without the sizes in the title bar. Output does claim it's using the qlImageSize generator - perhaps someone with more experience in QL can spot an error I've made here:

$ qlmanage -p -g ~/Library/QuickLook/qlImageSize.qlgenerator -c jpg ~/Downloads/medium.jpg
ChesterYue commented 4 years ago

Reason:

This issue is actually caused by the macOS 10.15.4 won't call the function QuickLookGeneratorPluginFactory of custom plugin which is not same as the macOS 10.14.6;

Detail:

How I debug with this project by the steps:

  1. git clone https://github.com/Nyx0uf/qlImageSize.git
  2. cd qlImageSize
  3. tar xJvf images-samples.txz (decompress sample image in the project)
  4. open qlImageSize.xcodeproj
  5. Xcode top menu: Product -> Scheme -> Edit Scheme
    • Info -> Executable -> Other -> cmd + shift + g -> /usr/bin/qlmanage 1
    • Arguments: 3 [A] copy from 3 [B] copy result from terminal: realpath Users/benjamin/btsync/projects/qlImageSize/images-samples/webp.webp [C] webp
    • close
  6. add breakpoint in QuickLookGeneratorPluginFactory of main.m 4
  7. Xcode top menu: Product - Run, break point is hit with webp on macOS 10.15.4 (if not, try to restart Xcode, god bless Apple)
  8. but if replace webp to png, the break point is not hit with png on macOS 10.15.4.:
    • replace [B] with result from terminal realpath Users/benjamin/btsync/projects/qlImageSize/images-samples/png.png
    • replace [C] with png 5
    • after run project, the break point is not hit with png on macOS 10.15.4.
  9. but repeating the same steps wrote above on macOS 10.14.6, I find the break point is hit with both webp and png on macOS 10.14.6. It works well.

Conclusion until now:

As sabrex wrote the macOS 10.15.4 is not calling the custom quick look plugin with the common image file type such as png / jpg.

macOS 10.14.6 macOS 10.15.4
webp
png

PS:

As hazarek wrote I love this handy feature too. Sadly I can't fix it so far. If anyone have any thought, please leave a comment. 😭😭😭

sbarex commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

ChesterYue commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

As Xcode(11.4) is not able to create QuickLook project already (since some Xcode version before), I think Apple is going to be disregard for maintaining the QuickLook development. 🙁🙁🙁

setanarut commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

As Xcode(11.4) is not able to create QuickLook project already (since some Xcode version before), I think Apple is going to be disregard for maintaining the QuickLook development. 🙁🙁🙁

So does it mean it is impossible to show Quicklook title bar information?

ChesterYue commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

As Xcode(11.4) is not able to create QuickLook project already (since some Xcode version before), I think Apple is going to be disregard for maintaining the QuickLook development. 🙁🙁🙁

So does it mean it is impossible to show Quicklook title bar information?

I think so with the information i got as so far.

setanarut commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

As Xcode(11.4) is not able to create QuickLook project already (since some Xcode version before), I think Apple is going to be disregard for maintaining the QuickLook development. 🙁🙁🙁

So does it mean it is impossible to show Quicklook title bar information?

I think so with the information i got as so far.

But sbarex's plugin can modify the quicklook window (right click, cursor selection). I'm just thinking. i'm not a Apple developer.

ChesterYue commented 4 years ago

I have pull a request of info about this behavios to the apple support about october 2019, but without any response.

As Xcode(11.4) is not able to create QuickLook project already (since some Xcode version before), I think Apple is going to be disregard for maintaining the QuickLook development. 🙁🙁🙁

So does it mean it is impossible to show Quicklook title bar information?

I think so with the information i got as so far.

But sbarex's plugin can modify the quicklook window (right click, cursor selection). I'm just thinking. i'm not a Apple developer.

It's not about the ability to modify window, the key point is the common image file type (png) which is not support to using customized plugin. I think sbarex knows what's going on.

sbarex commented 4 years ago

The new appex extension is the replacement for the old quicklook generator. It's allow more customization of the interface (not the title bar, but you can insert a label where you want inside the window) but, like custom generator, it cannot handle many file standard format reserverd by the OS. Sorry but Apple has taken a step back.

ChesterYue commented 4 years ago

The new appex extension is the replacement for the old quicklook generator. It's allow more customization of the interface (not the title bar, but you can insert a label where you want inside the window) but, like custom generator, it cannot handle many file standard format reserverd by the OS. Sorry but Apple has taken a step back.

See it, let me study this tomorrow!

ChesterYue commented 4 years ago

run: qlmanage -m result: public.image -> /System/Library/QuickLook/Image.qlgenerator (906.2)

try: sudo mv /System/Library/QuickLook/Image.qlgenerator ~/Desktop qlmanage -r; qlmanage -m; result: public.image -> /Users/xxx/Library/QuickLook/qlImageSize.qlgenerator (2.6.1)

but still not working.

Sponge-bink commented 4 years ago
  1. Xcode top menu: Product - Run, break point is hit with webp on macOS 10.15.4 (if not, try to restart Xcode, god bless Apple)
  2. but if replace webp to png, the break point is not hit with png on macOS 10.15.4.:

I did exactly the same on Xcode 11.6 macOS 10.15.5, and get the exactly same result. The resolution info showed on the preview of the webp file but not on the png one.

strafe commented 4 years ago

@ChesterYue have you had chance to see if Big Sur changes this behaviour back?

sbarex commented 4 years ago

For Catalina (and Big Sur) I created a Finder Sync extension to see the image resolution (and also some other info) inside the contextual menu. It also support movie and audio files. Is not the same to see the info on the quicklook preview but it can be useful.

Lessica commented 2 years ago

Tested on macOS Monterey: qlImageSize won't work for any format it supported now.

.bpg -> dyn.ah62d4rv4ge80e6dh .webp is now declared by system.

kMDItemContentType                     = "org.webmproject.webp"
kMDItemContentTypeTree                 = (
    "org.webmproject.webp",
    "public.image",
    "public.data",
    "public.item",
    "public.content"
)

The new QuickLook extensions (.appex) won't work for system declared UTIs.

toFrankie commented 9 months ago

This plugin is great. Hope there will be a turnaround in the future.

Joan commented 9 months ago

https://github.com/sbarex/MediaInfo is a great replacement: it shows more info in the contextual menu for more file types, and is higly customisable

setanarut commented 9 months ago

https://github.com/sbarex/MediaInfo is a great replacement: it shows more info in the contextual menu for more file types, and is higly customisable

it is not a replacement. macOS already has a similar feature that's easier. Choose File > Get Info, or press Command-I.