ZX-Image
Moderator: druellan
Re: ZX-Image
Today update:
1. Fixed a lot of issues which appeared during my switch to psalm static analysis. Some of formats were not working at all
2. I've added example for each format supported by library, so currently they are all working (at least with my test data)
3. Added support for SSX-Raw
4. Fixed issue with mime-type passing for SSX.
Now will look onto any way to run it on an older PHP versions, because I'm ultimately aiming to switch to PHP8 with its features.
1. Fixed a lot of issues which appeared during my switch to psalm static analysis. Some of formats were not working at all
2. I've added example for each format supported by library, so currently they are all working (at least with my test data)
3. Added support for SSX-Raw
4. Fixed issue with mime-type passing for SSX.
Now will look onto any way to run it on an older PHP versions, because I'm ultimately aiming to switch to PHP8 with its features.
Re: ZX-Image
I've managed to transpile the latest version of library into PHP7.0-compatible code using Rector.
This is feature/PHP7.0 branch in Github, I've also made a separate tag 5.2.0.1 for this release.
So if you need version for 7.0, then please run the following composer command in root of your project.
composer require "moroz1999/zx-image:5.2.0.1"
This is feature/PHP7.0 branch in Github, I've also made a separate tag 5.2.0.1 for this release.
So if you need version for 7.0, then please run the following composer command in root of your project.
composer require "moroz1999/zx-image:5.2.0.1"
Re: ZX-Image
Next formats to support: GRF from ZX Evo, textmode from ZX81
- pavero
- Dynamite Dan
- Posts: 1599
- Joined: Sat Dec 09, 2017 11:49 pm
- Location: The Czech Republic
- Contact:
Re: ZX-Image
Thanks [mention]moroz1999[/mention] !
The version for PHP 7.4 works perfectly for me, but version for PHP 7.0 not.
I always get a message "Class not found" ...
http://127.0.0.1/zx/vendor/moroz1999/zx ... script.php
$className = 'ZxImage\Plugin\Standard'
The version for PHP 7.4 works perfectly for me, but version for PHP 7.0 not.
I always get a message "Class not found" ...
http://127.0.0.1/zx/vendor/moroz1999/zx ... script.php
Code: Select all
<?php
include_once('Converter.php');
$converter = new \ZxImage\Converter();
$converter->setType('standard');
$converter->setPath('example.scr'); //
$converter->setBorder(5); //cyan
$converter->setZoom(1); //1 for 320*240 (256*192 with border)
//convert and return image data
if ($binary = $converter->getBinary()) {
//after conversion we can ask for a mime type of last operation and send it to browser
if ($imageType = $converter->getResultMime()) {
header('Content-Type: ' . $imageType);
}
//send image contents to browser
echo $binary;
} else {
echo "err Class not found";
}
?>
- pavero
- Dynamite Dan
- Posts: 1599
- Joined: Sat Dec 09, 2017 11:49 pm
- Location: The Czech Republic
- Contact:
Re: ZX-Image
Well, I had to add ...
And it works now ...
Code: Select all
include_once('../../../../vendor/autoload.php');
- pavero
- Dynamite Dan
- Posts: 1599
- Joined: Sat Dec 09, 2017 11:49 pm
- Location: The Czech Republic
- Contact:
Re: ZX-Image
[mention]PeterJ[/mention] I have implemented the newest version of ZX-Image on the server.
https://spectrumcomputing.co.uk/ssx-example.php
How I noticed, SCR cache never worked. And I don't know if there was your intention.
I have created 'SCRcache' folder. But I guess it will be generated huge number of files on the server now.
https://spectrumcomputing.co.uk/ssx-example.php
How I noticed, SCR cache never worked. And I don't know if there was your intention.
I have created 'SCRcache' folder. But I guess it will be generated huge number of files on the server now.
Re: ZX-Image
Nice!pavero wrote: ↑Sun Dec 06, 2020 9:27 am @PeterJ I have implemented the newest version of ZX-Image on the server.
https://spectrumcomputing.co.uk/ssx-example.php
How I noticed, SCR cache never worked. And I don't know if there was your intention.
I have created 'SCRcache' folder. But I guess it will be generated huge number of files on the server now.
Using cache is generally a good idea, some formats can be really cpu-consumable and as far as I see the parsing is really far for optimal in my old implementation
The library would delete the old files from cache automatically, but just for a case keep an eye on files amount.
Re: ZX-Image
Yep, as a composer library it depends on composer's autoloading of classes. So instead of manually including the file with class it's being taken from an agreed location automatically.pavero wrote: ↑Sat Dec 05, 2020 10:49 pm Well, I had to add ...
And it works now ...Code: Select all
include_once('../../../../vendor/autoload.php');
https://www.php.net/manual/en/language. ... toload.php
https://www.php-fig.org/psr/psr-4/
I'll update the example in readme.md, the example is from old pre-composer times.
Re: ZX-Image
[mention]moroz1999[/mention],
When you have time would you be able to update our server with the latest version? Let me know if you need a reminder of the server details. Thanks in advance.
When you have time would you be able to update our server with the latest version? Let me know if you need a reminder of the server details. Thanks in advance.
- pavero
- Dynamite Dan
- Posts: 1599
- Joined: Sat Dec 09, 2017 11:49 pm
- Location: The Czech Republic
- Contact:
Re: ZX-Image
Have you read my previous post?
Re: ZX-Image
Sorry, [mention]pavero[/mention],
I missed it. Apologies. Thank you for doing that!
I missed it. Apologies. Thank you for doing that!
Re: ZX-Image
So, is everything ok now? No more help required currently from my side?
- pavero
- Dynamite Dan
- Posts: 1599
- Joined: Sat Dec 09, 2017 11:49 pm
- Location: The Czech Republic
- Contact:
Re: ZX-Image
Yes, at least for now. We will see in the future, because now we don't have any SSX file in ZXDB.
Re: ZX-Image
I have a batch of Sam Coupe games that need screens. I was going to do PNG, but will produce some in SSX during the week and share with you. Peter
Re: ZX-Image
Just wish I found this thread ealier, spend a few days getting latest version of zx_image to work with php 8 invoked from commandline
FYI - there are some constructions around accessing array elements in GifCreator that needs to change from {} to [] when moving to PHP 8
But now it works for me..
/Thomas
FYI - there are some constructions around accessing array elements in GifCreator that needs to change from {} to [] when moving to PHP 8
But now it works for me..
/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
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend