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

Save image bug with filepath #1252

Closed
Jordatious opened this issue Apr 6, 2023 · 5 comments · Fixed by #1290
Closed

Save image bug with filepath #1252

Jordatious opened this issue Apr 6, 2023 · 5 comments · Fixed by #1290
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Jordatious
Copy link

On the IDIA CARTA server (running v3.0.1), I open one of the THINGS cubes (from /carta_share/public/jcollier/THINGS/), create a moment map or PV diagram, and then File --> Save image. In the file browser, when I try to save the image, a red box pops up with the following error msg: "Cannot save image type from loader.Directory: /carta_share/public/collier/THINGS does not exist and cannot be created".

I then go back to the root directory and navigate back to the same directory, and save again, which is successful.

Even if I try to overwrite a file, a dialog pops up to mention the file exists and asks if I want to overwrite it, but attempting to save/overwrite it causes the same issue.

@Jordatious Jordatious added the bug Something isn't working label Apr 6, 2023
@kswang1029 kswang1029 transferred this issue from CARTAvis/carta Apr 7, 2023
@kswang1029
Copy link
Contributor

presumably this is a backend issue.

@kswang1029
Copy link
Contributor

@veggiesaurus do you have time to have a look?

@kswang1029
Copy link
Contributor

@veggiesaurus do you have time to have a look (need the ilifu env to test)?

@kswang1029 kswang1029 added this to the v4.0-stable milestone May 11, 2023
@confluence
Copy link
Collaborator

This is happening when the output directory path passed to the backend is absolute. Navigating all the way back to the root directory resets the path and all its children to relative paths. I suspect that the problem is that the absolute path is being passed to casacore as-is, and casacore is interpreting it as a valid absolute filesystem path (but it's not; it's relative to a root directory -- possibly this bug isn't triggered if the root directory is the filesystem root). I don't think that the absolute path input is incorrect (it works fine in the file list request), so we're probably missing a normalization step. I will investigate further how these paths are being handled.

@confluence confluence assigned pford and unassigned confluence Jul 26, 2023
@confluence
Copy link
Collaborator

More specific steps to reproduce:

  1. launch carta with a top-level directory set
  2. enable logging of SAVE FILE messages
  3. create a PV image (moment map probably works too)
  4. use the save image menu item to open the save dialog
  5. in the file browser, make sure you're several directories deep from the top-level folder, and then click on a directory other than the top level directory in the breadcrumbs
  6. try to save the file

Using the breadcrumbs to navigate to a directory prepends / to the path (and it is preserved when you use the filesystem list to navigate after that, but clicking on the top-level folder resets the path to . and after that the lack of leading / is preserved). This does not seem to happen if the top-level directory is set to the filesystem root. This form of the path doesn't seem to cause any problems with other types of requests, like fetching directory listings or opening images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants