How take Loading and Running Screens?

This is the place for general discussion and updates about the ZXDB Database. This forum is not specific to Spectrum Computing.

Moderator: druellan

Post Reply
User avatar
Turrican
Microbot
Posts: 187
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

How take Loading and Running Screens?

Post by Turrican »

Hi guys!
How can I take the loading and running screens from ZXDB?

For example in the API I have the data:
"filename": "0030985-run-1.png",
"size": 8274,
"format": "Picture",
"type": "Running screen",
"title": "",
"url": "/zxscreens/0030985/0030985-run-1.png"

But from where can I load this image?
I didn´t find this info in the Github.

Thank you!
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: How take Loading and Running Screens?

Post by kolbeck »

These are from the "screens" section which are API specific. You need to look into the additional section:
"additionals": [
{
"url": "/zxdb/sinclair/entries/0030985/0030985-load-1.scr",
"type": "Loading screen",
"format": "Screen dump"
},
{
"url": "/zxdb/sinclair/entries/0030985/0030985-run-1.scr",
"type": "Running screen",
"format": "Screen dump"
}
],

And then follow the "Additional" guide on github
https://github.com/zxdb/ZXDB

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Turrican
Microbot
Posts: 187
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: How take Loading and Running Screens?

Post by Turrican »

Thank you!
User avatar
arjun
Microbot
Posts: 146
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: How take Loading and Running Screens?

Post by arjun »

Would appreciate some more clarifications on the same subject. Is there no point to the URLs with /zxscreens/ path in the Screen section of games API?
Do we have to get the .SCR file and then convert to PNG as required?
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: How take Loading and Running Screens?

Post by 4thRock »

Check ZX-Image:
PHP-based ZX Spectrum images parsing into PNG/GIF. Supports animation, supports file caching.

https://github.com/moroz1999/zx-image
User avatar
Morkin
Bugaboo
Posts: 3250
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: How take Loading and Running Screens?

Post by Morkin »

arjun wrote: Wed Mar 30, 2022 1:24 pm Would appreciate some more clarifications on the same subject. Is there no point to the URLs with /zxscreens/ path in the Screen section of games API?
Do we have to get the .SCR file and then convert to PNG as required?
Aren't some of them already .png files? Is there a mix?

e.g.

Code: Select all

url: "/zxscreens/0004665/SpaceHarrierII-load.png"
Disclaimer: I'm an API noob
My Speccy site: thirdharmoniser.com
User avatar
arjun
Microbot
Posts: 146
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: How take Loading and Running Screens?

Post by arjun »

4thRock wrote: Wed Mar 30, 2022 2:05 pm Check ZX-Image:
PHP-based ZX Spectrum images parsing into PNG/GIF. Supports animation, supports file caching.

https://github.com/moroz1999/zx-image
Thanks, but I'm using Windows Forms, so PHP isn't an option. :)
User avatar
arjun
Microbot
Posts: 146
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: How take Loading and Running Screens?

Post by arjun »

Morkin wrote: Wed Mar 30, 2022 4:10 pm Aren't some of them already .png files? Is there a mix?

Code: Select all

url: "/zxscreens/0004665/SpaceHarrierII-load.png"
That's exactly the confusion. The URL seems to suggest there is a PNG version of the file, but it doesn't say *where* to get it from. the "/zxscreens/" is a local path, but where is it hosted? That was my original question.

If only the SCR is actually available I was wondering if there is the possibility of providing a PNG alternative as well. After all, the rest of the screenshots are PNG so there is no reason to retain just the SCR version of this file.

EDIT:
It turns out that these paths can be resolved by prefixing "https://zxinfo.dk/media" to the URL. This website belongs to @kolbeck if I'm not wrong. While it works if I do this, I'm not sure if this is intentional and whether kolbeck intends the URLs to be used this way. If it isn't please let me know so that I can try different approach.
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: How take Loading and Running Screens?

Post by 4thRock »

You need to handle image display on your end, as ZXDB will only provide relative paths and in most cases native formats.
Each ZXDB site/app handles paths and image conversions differently, with custom solutions as needed.
Linking to existing sites is not a good practice, because of increased traffic triggering server hotlink protection, and probable cross-domain loading problems.
User avatar
Morkin
Bugaboo
Posts: 3250
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: How take Loading and Running Screens?

Post by Morkin »

arjun wrote: Thu Mar 31, 2022 5:52 am It turns out that these paths can be resolved by prefixing "https://zxinfo.dk/media" to the URL. This website belongs to @kolbeck if I'm not wrong. While it works if I do this, I'm not sure if this is intentional and whether kolbeck intends the URLs to be used this way. If it isn't please let me know so that I can try different approach.
The API notes say it's OK (we're all good Spec-citizens, right? :))

I did this for any running screens sourced at /zxdb/sinclair/:

Code: Select all

imageDisplay.setAttribute('src', "https://zxinfo.dk/media" + imageUrl);
My Speccy site: thirdharmoniser.com
User avatar
arjun
Microbot
Posts: 146
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: How take Loading and Running Screens?

Post by arjun »

Morkin wrote: Thu Mar 31, 2022 9:12 am
The API notes say it's OK (we're all good Spec-citizens, right? :))

I did this for any running screens sourced at /zxdb/sinclair/:

Code: Select all

imageDisplay.setAttribute('src', "https://zxinfo.dk/media" + imageUrl);
Cheers Morkin! Good to know I'm not doing something blatantly suspicious! :lol:
User avatar
kolbeck
Manic Miner
Posts: 309
Joined: Mon Nov 13, 2017 9:04 pm

Re: How take Loading and Running Screens?

Post by kolbeck »

ZXInfo converts SCR to gif or png to help if clients do prefer not to handle it on the run, for example mobile apps. So yes, its perfectly fine to use Them - i might even consider updating the API doc :shock:
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
Post Reply