Page 1 of 1

How take Loading and Running Screens?

Posted: Tue Aug 14, 2018 1:16 am
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!

Re: How take Loading and Running Screens?

Posted: Tue Aug 14, 2018 11:25 am
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

Re: How take Loading and Running Screens?

Posted: Tue Aug 14, 2018 10:53 pm
by Turrican
Thank you!

Re: How take Loading and Running Screens?

Posted: Wed Mar 30, 2022 1:24 pm
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?

Re: How take Loading and Running Screens?

Posted: Wed Mar 30, 2022 2:05 pm
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

Re: How take Loading and Running Screens?

Posted: Wed Mar 30, 2022 4:10 pm
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

Re: How take Loading and Running Screens?

Posted: Thu Mar 31, 2022 5:48 am
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. :)

Re: How take Loading and Running Screens?

Posted: Thu Mar 31, 2022 5:52 am
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.

Re: How take Loading and Running Screens?

Posted: Thu Mar 31, 2022 8:53 am
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.

Re: How take Loading and Running Screens?

Posted: Thu Mar 31, 2022 9:12 am
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);

Re: How take Loading and Running Screens?

Posted: Thu Mar 31, 2022 11:37 am
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:

Re: How take Loading and Running Screens?

Posted: Sat Apr 30, 2022 9:11 am
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: