Observatory not opening FITS images

Started by fsantore, December 20, 2023, 11:35:07 AM

Previous topic - Next topic

fsantore

In my quest to get Quick Look FITS functionality back working, I'm at the state where a right-click on an image shows Observatory as the default for opening.  However, when Observatory launches the following error appears:

"The document "2014WV5351.00227.fit" could not be opened. Observatory cannot open files in the "FITS Image" format."

Note I've been working this for some time, having issued the following terminal commands:

qlmanage -r
qlmanage -r cache
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -r -v /Applications/Observatory.app
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
qlmanage -m plugins|grep fits

The final command produces no returned response, which is most likely part and parcel with the problem.

I'm running Observatory Version 2.0.4 (58)
MacOS Sonoma 14.2.1 (23C71)

though I'm not sure it is a version problem.  I believe FITS Quick Look may have been inoperable here for some time, and I'm just getting around to addressing this much appreciated Observatory functionality.

I should mention that rebuilding LaunchServices database completely, with the command
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
does rectify the situation, but only until the next reboot when all is once again broken.

Thank you in advance for any help as I have done my diligence on this one without a final multi-boot resolution, and Happy Holidays to Code Obsession and the great forum members.

       -Frank (San Diego)

Sander Berents

Hi Frank,

Do you have any other Quick Look FITS plugin installed? I remember that QuickFits was causing conflicts in the past, but I can't find the details. Do you still have Observatory 1.6.7 on your system? It uses the older Quick Look APIs, and although I never encountered any conflicts between the two, it is best to remove it. Please also check the Quick Look Extensions in the System Settings to ensure that the Observatory Previews & Thumbnails extensions are enabled.
Sander Berents
Code Obsession, LLC
https://codeobsession.com

fsantore

Hello again Sander-

     I don't recall ever having dealt with a Quick Look FITS plugin, but I would need more help in knowing how to verify it is not installed.  I only really know about Safari plugins.  I did check the System Settings, and found the Observatory extensions with both checkboxes enabled.  My first concern is FITS files cannot be imported into Observatory.  Importing results in no action and no error message.  Selecting a FITS file in the finder will present the error box previously mentioned.  I have deleted Observatory from the Applications folder, and redownloaded it from the App store without avail.  Perhaps a more complete delete is needed including Library and other files?  Also, to your question about the prior version, I only show the current version in the Applications folder.

     Thanks for giving this some thought.

Sander Berents

Observatory 2 uses the new Quick Look Extension APIs, which is why it now shows up in the System Settings. qlmanage -m plugins only shows the Quick Look Generators that use the old API (like Observatory 1.x did), so that it is not listed there is as expected.

If you right click a FITS file, what will Finder show in the "Open With" submenu? And for other file types? You may be able to force the system to associate Observatory with FITS files again by selecting a FITS file, right click and select "Show Info", and then in the window that opens under "Open with" choosing Observatory and then "Change All".

Clearly there's a corruption with your system's LaunchServices database. But you already rebuilt it to no (permanent) avail. Then again, maybe the parameters of the lsregister command changed in more recent macOS versions.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -h shows all options of lsregister.

Most likely you need to do a /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -delete, followed by a reboot, to have the system create a completely new database. Before executing that command, please make a Time Machine backup of your system. I have never tried that parameter myself, and do not know if it will solve the problem or make matters worse. The issue is not with Observatory or its Quick Look Extension, but with your LaunchServices database.

Sander Berents
Code Obsession, LLC
https://codeobsession.com

fsantore

Thanks Sander,

  I've of course been thinking there is a system problem, not an Observatory problem.  LaunchServices does indeed seem the most likely culprit.  I've run the -h option, followed by the "-kill -r -domain local -domain system -domain user" command that brings the functionality back.  I think I'm going to have to leave it at that until after some Christmas travel.

  If you review thew first line of my initial post, you'll see Observatory is the default app for FITS files.  Though that was not the case before tunneling down the rabbit hole prior to hitting bottom and posting here.  Of note, I think Tycho (Tycho-Tracker.com) was the default at that time, and still shows as the only other 'Open With' selection once rebooting.  It's gone now that I've issued the 'make it better until reboot' command.  I think FITS Quick Look was broken before my Tycho investigations, but if you have a test machine it might be informative to load Tycho up to see what happens.

   Once back from travel in the New Year, I'll perhaps issue the LaunchServices -delete command, but first verify rebooting reinstates the problem.

    I hope your Holidays are merry, and thanks for your well appreciated help today and in past times.

    -Frank

Sander Berents

#5
I downloaded Tycho and looked at its internal Info.plist and see that it is most likely to blame.

Whereas Observatory correctly describes the FITS file format with its gov.nasa.gsfc.fits identifier, its correct URL, "conforms to" types and mime type, Tycho claims it as its own file format (com.tycho-tracker.fits), and with a URL that points to the wikipedia FITS page. Tycho also sets itself up as an "editor" of FITS files, and so macOS gives it a higher priority over Observatory (it sets itself up as a "viewer"). Since Tycho uses the wrong identifier, Observatory looses access to FITS files.

So, remove Tycho or contact its author to have its FITS definitions fixed so it plays nice with other macOS astronomy software.

Enjoy the holidays!
Sander Berents
Code Obsession, LLC
https://codeobsession.com

Sander Berents

Update: Frank has contacted the Tycho developer. The application has been updated and now uses the correct FITS identifier, resolving the problem for Observatory and other software.
Sander Berents
Code Obsession, LLC
https://codeobsession.com