Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening File with HDFView Opens Empty Window #123

Open
sanssecours opened this issue Apr 23, 2023 · 3 comments
Open

Opening File with HDFView Opens Empty Window #123

sanssecours opened this issue Apr 23, 2023 · 3 comments
Assignees
Labels
Component - Documentation Improvements or additions to documentation Type - Task Actions that don't fit into any other type category

Comments

@sanssecours
Copy link

Description

Opening a HDF5 file on macOS (e.g. in Finder) with HDFView does not work. Instead of opening a window containing the actual HDF file HDFView presents an empty window.

Steps to Reproduce

  1. Select an example HDF5 (e.g. experiment.hdf5) file in Finder

  2. Open the info dialog: + I

  3. Select HDFView under “Open with”

    Open With
  4. Close the info dialog: + W

  5. Double-Click on the example HDFView file

Expected Result

HDFView opens the example file in the sidebar:

Expected Result

Actual Result

HDFView opens an empty window:

Actual Result

Workaround

Open the file using the executable inside the application directory:

/Applications/HDFView.app/Contents/MacOS/HDFView ~/Documents/Work/Projects/ICOtronic/Software/ICOc/experiment.hdf5

General Information

OS: macOS 13.3.1
HDFView Version: 3.3.0

@byrnHDF
Copy link
Collaborator

byrnHDF commented May 7, 2023

This is a known problem on the macs. Unfortunately it is missing from the list of known problems.

@byrnHDF byrnHDF added Component - Documentation Improvements or additions to documentation Type - Task Actions that don't fit into any other type category labels May 7, 2023
@byrnHDF byrnHDF self-assigned this Jun 12, 2023
@kamisori
Copy link

on ubuntu 22, installed with HDFView-3.3.1-ubuntu2204_64.tar.gz:

similar, but instead of an empty window you get just the file entry, no contents.

when started in a console, all it ever outputs is
"[warning] /usr/bin/hdfview: JVM flavor 'sun' not understood"

is this related to not being able to open files?

on subsequent clicks on the file entry 'log info' says "file is in use", on rightclick the 'open'-entry is gray

@rly
Copy link

rly commented Dec 21, 2023

This would be very nice to fix. In my work, I inspect a lot of HDF5 files using HDFView on my Mac, and having to copy and paste the path into the HDFView open dialog each time is a pain. Double-clicking the file in the Finder to open the file with HDFView would be so nice.

Looking at various SO posts, would something like this work within main()?

  if (System.getProperty("os.name").contains("OS X")) {
    com.apple.eawt.Application a = com.apple.eawt.Application.getApplication();
    a.setOpenFileHandler(new com.apple.eawt.OpenFilesHandler() {

        @Override
        public void openFiles(com.apple.eawt.AppEvent.OpenFilesEvent e) {
            for (File file : e.getFiles()){
                String filename = file.getAbsolutePath();
                openLocalFile(filename, -1);
            }
        }

    });

I haven't coded in Java in a long time and do not have the environment set up to test it, but maybe this will point someone else in the right direction for a fix. I'm also not sure if com.apple.eawt still exists and can be called...

Happy to test a fix if that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Documentation Improvements or additions to documentation Type - Task Actions that don't fit into any other type category
Projects
None yet
Development

No branches or pull requests

4 participants