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

Perseverance: Grab full resolution PNG images #130

Open
samgrover opened this issue Feb 23, 2021 · 9 comments
Open

Perseverance: Grab full resolution PNG images #130

samgrover opened this issue Feb 23, 2021 · 9 comments

Comments

@samgrover
Copy link

The Perseverance team is releasing images in full resolution in PNG format. These URLs are included in the feed.

The recently added support for Perseverance grabs the URL for large image (in JPG format). Please also grab the URL for full_res image (in PNG format) for all photos where it is available.

If I was familiar with Ruby, I would totally submit a pull request.

Thank you for your consideration.

@corincerami
Copy link
Owner

It seems like to get the full_res URL, all that's needed is to remove the last section of it which adds the size constraint and change the file extension to png. For example,

https://mars.nasa.gov/mars2020-raw-images/pub/ods/surface/sol/00004/ids/edr/browse/ncam/NLM_0004_0667310972_991ECM_N0010052AUT_04096_00_2LLJ01_1200.jpg

becomes

https://mars.nasa.gov/mars2020-raw-images/pub/ods/surface/sol/00004/ids/edr/browse/ncam/NLM_0004_0667310972_991ECM_N0010052AUT_04096_00_2LLJ01.png

Rather than storing and presenting multiple URLs in the API, perhaps you can manage this in your application.

@samgrover
Copy link
Author

That could work if that assumption on URL structure can hold for the lifetime of the rover. I'm not well versed with these data sets. In your experience, is the structure likely to change?

@corincerami
Copy link
Owner

Based on my experience with the other rover datasets, that seems very unlikely. They tend to be very structured.

@mtilda
Copy link

mtilda commented Feb 25, 2021

@chrisccerami is this a feature you are interested in adding? Or is there a reason you would not want to add it.

It seems like we could add this feature to the photos controller by checking for a size parameter (possible values: "small", "medium", "large" (default), "full_res").

We wouldn't need to store extra data. We would only need to create a function to mutate the URL to correspond with the selected size.

I am happy to spend some time working on this.

@corincerami
Copy link
Owner

@mxkay if you want to give it a shot, I'd be open to it. If folks think that would be a useful feature I'm certainly not opposed to it.

@samgrover
Copy link
Author

I'm primarily interested in the lossless PNG file. I could work with the workaround suggested above, but a dedicated entry in the response would be wonderful.

@mtilda
Copy link

mtilda commented Feb 26, 2021

Sweet :) I will begin working on adding a photo size parameter to the API. @chrisccerami should I make a new issue for that?

@corincerami
Copy link
Owner

That's not necessary, you can just reference this issue in your PR. Thank you.

@ken-2021
Copy link

In python
Import requests
Get url
Open file to get content should be "true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants