Page 1 of 1

XNView

Posted: Mon Oct 23, 2017 8:20 pm
by BeebMaster
I just downloaded XNView on Ubuntu, although I understand that there may also be a version for another current operating system that a few people are using.

I installed it because I wanted to be able to view Acorn Sprite files (ie. from !Paint or *SCREENSAVE etc) on PC without having to convert them on the Acorn machine first.

It lists Acorn Sprite format as one of its 500 supported filetypes.

Doesn't work though, preview of sprites just shows as a grey-and-white check.

Anyone had experience of using Sprite files in XNView? Or anything else even?

Re: XNView

Posted: Mon Oct 23, 2017 9:14 pm
by paulb
BeebMaster wrote:Anyone had experience of using Sprite files in XNView? Or anything else even?
I've used davidb's spritefile module which did even provide a GIMP plugin after some messing around I once did, but I'm not sure that the plugin still works. Still, the command line tools probably keep doing the business.

Re: XNView

Posted: Mon Oct 23, 2017 10:00 pm
by richardtoohey
@BeebMaster - can you post a sample file?

Re: XNView

Posted: Tue Oct 24, 2017 11:25 pm
by BeebMaster
Here we are - one is a screenshot I made with !Snapper, another is a !Paint daub.

Re: XNView

Posted: Tue Oct 24, 2017 11:53 pm
by richardtoohey
Thanks; I did Google for some sample files but wasn't sure what I was looking at ... so would end up barking up the wrong tree!

Will have a play and see if I can find anything useful ...

Re: XNView

Posted: Wed Oct 25, 2017 7:36 am
by richardtoohey
Urgh ... my plan was to have a look at XNView, check out the source and see what was going on.

But it's closed source ... and I had a mission even getting it to run on Ubuntu (tried 17.04 then 17.10) and got lost in a world of misery (the software center saying it was/wasn't/was installed, saying I needed to register for something, saying the install had failed, but installing something, learning about Ubuntu snaps, etc.) I did get it running but it wouldn't even open the file (tried renaming to .acorn etc.)

davidb/paulb's code might be a better starting point than this XNView stuff. :?:

Re: XNView

Posted: Wed Oct 25, 2017 3:06 pm
by davidb
I used spr2img from the Spritefile package to convert the two sprites. I hope they are represented correctly. Use

Code: Select all

python setup.py build
and

Code: Select all

sudo python setup.py install
to build and install the modules and spr2img tool on your system.

Re: XNView

Posted: Sat Oct 28, 2017 9:41 am
by BeebMaster
I had no problem installing XNView, just downloaded the deb, double-clicked it and pressed install.

Spritefile sounds promising, I downloaded python imaging library, built, installed, downloaded spritefile, built, installed BUT

Code: Select all

spr2img.py Screen0.acorn convert.png
Traceback (most recent call last):
  File "/usr/local/bin/spr2img.py", line 27, in <module>
    import cmdsyntax, Image, os, spritefile, sys
ImportError: No module named cmdsyntax

Re: XNView

Posted: Sat Oct 28, 2017 12:20 pm
by paulb
BeebMaster wrote:I had no problem installing XNView, just downloaded the deb, double-clicked it and pressed install.

Spritefile sounds promising, I downloaded python imaging library, built, installed, downloaded spritefile, built, installed BUT

Code: Select all

spr2img.py Screen0.acorn convert.png
Traceback (most recent call last):
  File "/usr/local/bin/spr2img.py", line 27, in <module>
    import cmdsyntax, Image, os, spritefile, sys
ImportError: No module named cmdsyntax
The cmdsyntax module is available here. I'm not sure Dave has a newer page for it, or whether it also resides in an online repository.

Re: XNView

Posted: Sat Oct 28, 2017 12:36 pm
by davidb
paulb wrote:The cmdsyntax module is available here. I'm not sure Dave has a newer page for it, or whether it also resides in an online repository.
No, I never bothered to put the repository anywhere public. I suppose I could do that.

Alternatively, or maybe additionally, I could remove the cmdsyntax code from the spr2img tool since it doesn't really need any of the features it provides. I think I'll do that, anyway.

Re: XNView

Posted: Sat Oct 28, 2017 2:04 pm
by BeebMaster
Oh right, I didn't clock that I had a bit missing. Installed that now. Next problem:

Code: Select all

spr2img.py Screen0.acorn convert.png
Failed to open file for sprite: convert.png/screendump.png

Re: XNView

Posted: Sat Oct 28, 2017 2:34 pm
by davidb
Strange. Do you already have a file or directory called convert.png? It should complain if there's already something there called that.

Also, note that it creates a directory with the name you give it as the second argument. Spritefiles can contain multiple sprites, you see.

Re: XNView

Posted: Sun Oct 29, 2017 12:47 pm
by BeebMaster
No, that object didn't exist previously but it creates the directory during the run as you say. Then there is a 33 byte file inside with the name of the first sprite. So it can get as far as creating and writing to that file but then something must go wrong.

Not sure what to do next, I did copy & paste the whole terminal output during all the various bits of installation I was doing yesterday, I could post that if it might shed any light.

Re: XNView

Posted: Sun Oct 29, 2017 1:24 pm
by davidb
Feel free to send it to me in a PM.