Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Security check: INTRUDER ALERT!


devel / comp.sys.acorn.programmer / Re: Reading the dimensions of a sprite or JPEG on disk

SubjectAuthor
* Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
`* Re: Reading the dimensions of a sprite or JPEG on diskNews
 `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
  `* Re: Reading the dimensions of a sprite or JPEG on diskGerald Holdsworth
   `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
    `* Re: Reading the dimensions of a sprite or JPEG on diskGerald Holdsworth
     `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
      `* Re: Reading the dimensions of a sprite or JPEG on diskGerald Holdsworth
       `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
        +* Re: Reading the dimensions of a sprite or JPEG on diskGerald Holdsworth
        |`* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
        | `* Re: Reading the dimensions of a sprite or JPEG on diskGerald Holdsworth
        |  +- Re: Reading the dimensions of a sprite or JPEG on diskSteve Fryatt
        |  `* Re: Reading the dimensions of a sprite or JPEG on diskMartin Wuerthner
        |   `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
        |    `- Re: Reading the dimensions of a sprite or JPEG on diskSprow
        `* Re: Reading the dimensions of a sprite or JPEG on diskMartin
         `* Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers
          `* Re: Reading the dimensions of a sprite or JPEG on diskNews
           +- Re: Reading the dimensions of a sprite or JPEG on diskNews
           `- Re: Reading the dimensions of a sprite or JPEG on diskPaul Sprangers

1
Reading the dimensions of a sprite or JPEG on disk

<59ef9cf586Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=138&group=comp.sys.acorn.programmer#138

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 28 May 2022 12:08:24 +0200 (Custom)
Message-ID: <59ef9cf586Paul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 18
Injection-Date: Sat, 28 May 2022 12:08:34 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1090
 by: Paul Sprangers - Sat, 28 May 2022 10:08 UTC

Dear all,

I would like to know the x and y dimensions of a sprite or a JPEG on disk.
For a JPEG, I found the following OS call:

SYS "JPEG_FileInfo",0,path$ TO ,,x%,y%

"path$' is the path of the JPEG in question, obviously.
However, x% and y% are always 0. What am I doing wrong? And does a similar
call exist for sprites? OS_SpriteOp only examines sprites in a sprite pool,
not on disk - as far as I understand...

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<59ef9fa796chrisjohnson@spamcop.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=139&group=comp.sys.acorn.programmer#139

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 28 May 2022 05:38:04 -0500
From: chrisjoh...@spamcop.net (News)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 28 May 2022 11:37:50 +0100
Message-ID: <59ef9fa796chrisjohnson@spamcop.net>
References: <59ef9cf586Paul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.53-32 RC1
Organization: None
Lines: 9
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-HGz730CSLsOUTXfgdcrKfvzGhR2YxrD6Ab376rVKjMVeVx8Jhngb6Kx6HDf8o+VVO0v254u9uJh+5zm!r8qWlXabh/4J6u2SdFThPNOEnv5jH4f8GnZtiuaNwA5gSy4VFCLmP+DehqomXDJdc8YFMoTkR5MP!S9hM
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1150
 by: News - Sat, 28 May 2022 10:37 UTC

In article <59ef9cf586Paul@sprie.nl>,
Paul Sprangers <Paul@sprie.nl> wrote:
> SYS "JPEG_FileInfo",0,path$ TO ,,x%,y%

Should R0 on entry not have bit0 set,
i.e. SYS "JPEG_FileInfo",1,path$ TO ,,x%,y%

--
Chris Johnson

Re: Reading the dimensions of a sprite or JPEG on disk

<59efa0a626Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=140&group=comp.sys.acorn.programmer#140

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 28 May 2022 12:48:42 +0200 (Custom)
Message-ID: <59efa0a626Paul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 15
Injection-Date: Sat, 28 May 2022 12:48:47 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 971
 by: Paul Sprangers - Sat, 28 May 2022 10:48 UTC

In article <59ef9fa796chrisjohnson@spamcop.net>,
News <chrisjohnson@spamcop.net> wrote:

> Should R0 on entry not have bit0 set,
> i.e. SYS "JPEG_FileInfo",1,path$ TO ,,x%,y%

Oh dear, indeed! Problem partly solved.
And for a sprite?

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=141&group=comp.sys.acorn.programmer#141

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 28 May 2022 08:26:05 -0500
Date: Sat, 28 May 2022 14:26:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.1
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Content-Language: en-GB
Newsgroups: comp.sys.acorn.programmer
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl>
From: nos...@hollypops.co.uk (Gerald Holdsworth)
Organization: Repton Resource Page
In-Reply-To: <59efa0a626Paul@sprie.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
Lines: 25
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-A0R+Bl50Q9Hoij4RiDDXXpXTTOhl+u3GrPRwAKZxjguWRWLsvUqaSXGQaPkHK+2TOQUJDmqONLpe0u+!tmCH9qkRkIRNlpMdsaB+Mp+ePtJCsKRQY2bJ0Yglh5CdutfH7wj7U6VIjw565m6SmEd6jPvDcHL6!dfTY9y2JhotUFFjhDXDw9DV4kI8=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2051
 by: Gerald Holdsworth - Sat, 28 May 2022 13:26 UTC

On 28/05/2022 11:48, Paul Sprangers wrote:
> In article <59ef9fa796chrisjohnson@spamcop.net>,
> News <chrisjohnson@spamcop.net> wrote:
>
>> Should R0 on entry not have bit0 set,
>> i.e. SYS "JPEG_FileInfo",1,path$ TO ,,x%,y%
>
> Oh dear, indeed! Problem partly solved.
> And for a sprite?

Sprite files contain multiple sprites, so you would need to specify
which sprite you wanted dimensions of.

In order to read the dimensions (both JPEG and Sprite, or any image
format) you will need to read at least part of the file into memory
anyway. So why not just read the sprite file in, and then use SpriteOp
to read the dimensions of desired sprite(s)?

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

Re: Reading the dimensions of a sprite or JPEG on disk

<59f0aeac8aPaul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=142&group=comp.sys.acorn.programmer#142

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Mon, 30 May 2022 13:58:06 +0200 (Custom)
Message-ID: <59f0aeac8aPaul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 52
Injection-Date: Mon, 30 May 2022 13:58:11 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3141
 by: Paul Sprangers - Mon, 30 May 2022 11:58 UTC

In article <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> Sprite files contain multiple sprites, so you would need to specify
> which sprite you wanted dimensions of.

I think I better describe what I'm after, because I run into more problems
than reading sprite dimensions alone.

I would like to be able to drag either a single sprite or a JPEG to my
window, after which the BASIC program saves a sprite thumbnail of it,
preferably to an existing sprite file. The thumbnail should be 40x40 pixels
at maximum. I haven't been able to find a detailed description (or any
description at all) of how to do this.

At this moment I use the ChangeFSI library for the conversion, as described
in a document called "CmdBasUse", found within the ChangeFSI application
directory. After having typed "LIBRARY "<ChangeFSI$Dir>.ChangeFSI" at the
top of my program, I have access to the following function:

error% =
FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN
ram%,fast%)

A$ contains the paths and conversions details, as described in the same
document. Until now I only succeeded to convert small JPEGs, that are
converted to the desired sprite thumbnails indeed, but that are stored to
disc, rather than to an existing sprite file. Larger JPEGs fail to convert
at all, producing an error that I can't understand: "Unknown or missing
variable in "ChangeFSI" in "ChangeFSI" [sic] at line 1672" - a line that
has nothing to do with the routine in question. As I have very little to no
understanding of the parameters of the function, I assume that I don't use
them properly, although it does work for small JPEGs (smaller than 15KB,
approximately).

I let ChangeFSI create the spritearea%, as well as the workspace% and the
worklimit%, by entering -1,-1,0 respectively, as described in the document.
However, I've no idea what to do with the "RETURN ram%" parameter. I've
entered a random variable (r%), which seems to be accepted by the function.
But blindly experimenting with random spriteareas and workspaces has only
resulted in fatal errors so far. As usual, I've actually no idea what I'm
doing.

Would someone be willing to explain how to use this function properly, or
how to achieve my goal otherwise?

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=143&group=comp.sys.acorn.programmer#143

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 30 May 2022 09:16:15 -0500
Date: Mon, 30 May 2022 15:16:15 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.1
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Content-Language: en-GB
Newsgroups: comp.sys.acorn.programmer
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl>
From: nos...@hollypops.co.uk (Gerald Holdsworth)
Organization: Repton Resource Page
In-Reply-To: <59f0aeac8aPaul@sprie.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
Lines: 21
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kCOVHwtAOZP3RoRk08AWIaWfUbjTHFpJzQOQf5YkGb26zex5QuXYL0NqJmHdiABT+ivjsrdjy7toI1H!LePc+NGwWpXzqG0WNsqh3ZOsURaNeiC3DAjb9/ZEVRVHO8mUMi97vQFF/ZJ42oejpv5qbN4fvx8f!3Qc0semOHpcw7r6VwAnxabNbZuM=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2033
 by: Gerald Holdsworth - Mon, 30 May 2022 14:16 UTC

On 30/05/2022 12:58, Paul Sprangers wrote:

> At this moment I use the ChangeFSI library for the conversion, as described
> in a document called "CmdBasUse", found within the ChangeFSI application
> directory. After having typed "LIBRARY "<ChangeFSI$Dir>.ChangeFSI" at the
> top of my program, I have access to the following function:

I have no clue on the ChangeFSI functions, but what version are you
using? Also, what version of RISC OS?

The images you are dragging from, into your window, where are they
coming from? I.e., a file? another application?

Cheers,

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

Re: Reading the dimensions of a sprite or JPEG on disk

<59f0be8a9aPaul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=144&group=comp.sys.acorn.programmer#144

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Mon, 30 May 2022 16:51:25 +0200 (Custom)
Message-ID: <59f0be8a9aPaul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 21
Injection-Date: Mon, 30 May 2022 16:51:30 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1396
 by: Paul Sprangers - Mon, 30 May 2022 14:51 UTC

In article <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> I have no clue on the ChangeFSI functions, but what version are you
> using? Also, what version of RISC OS?

ChangeFSI 1.63
RISCOS 5.29

> The images you are dragging from, into your window, where are they
> coming from? I.e., a file? another application?

The images come from disk, typically photographs. So, not from a file, nor
from another application.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=145&group=comp.sys.acorn.programmer#145

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 30 May 2022 12:07:25 -0500
Date: Mon, 30 May 2022 18:07:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.1
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Content-Language: en-GB
Newsgroups: comp.sys.acorn.programmer
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl>
From: nos...@hollypops.co.uk (Gerald Holdsworth)
Organization: Repton Resource Page
In-Reply-To: <59f0be8a9aPaul@sprie.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Ch9XKCPn9T6UBLIYo3E0cXlKLu1LCs6viY73mM5KxGfVwKI5id/lWsLogjDsR02VWHp9W71GcjO1/W1!qpFMvsrxP4pa/vsgUtL/9hlxE38P5vSy/hvp9/3jxW9CZ/ssjaluEHzb60j/nbeXlJnZjReMkOZQ!mGx3YsmLxxvbCHClrNqjVqTSAA0=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2360
 by: Gerald Holdsworth - Mon, 30 May 2022 17:07 UTC

On 30/05/2022 15:51, Paul Sprangers wrote:
> In article <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>,
> Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
>
>> I have no clue on the ChangeFSI functions, but what version are you
>> using? Also, what version of RISC OS?
>
> ChangeFSI 1.63
> RISCOS 5.29
>
>> The images you are dragging from, into your window, where are they
>> coming from? I.e., a file? another application?
>
> The images come from disk, typically photographs. So, not from a file, nor
> from another application.
>

RISC OS 5.29 may be able to handle, and convert, JPEGs natively. !Paint
can certainly import a JPEG and output a Sprite, and it can also export
a JPEG. I'd have a hunt around the RO5 PRMs to see if there is anything,
or post on the ROOL forums.

Cheers,

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

Re: Reading the dimensions of a sprite or JPEG on disk

<59f119bd97Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=146&group=comp.sys.acorn.programmer#146

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 09:27:33 +0200 (Custom)
Message-ID: <59f119bd97Paul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe005.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 26
Injection-Date: Tue, 31 May 2022 09:27:39 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1834
 by: Paul Sprangers - Tue, 31 May 2022 07:27 UTC

In article <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> RISC OS 5.29 may be able to handle, and convert, JPEGs natively. !Paint
> can certainly import a JPEG and output a Sprite, and it can also export
> a JPEG.

Yes, I know. And both !ArtWorks and !DPlingScan can perfectly resize any
bitmap as well. But the point is that I want to do it myself - or better: I
don't want to force possible users of my program to be dependent of those
(commercial) programs. And I want to figure out how those programs do it...

> I'd have a hunt around the RO5 PRMs to see if there is anything,
> or post on the ROOL forums.

I did find some related posts on the ROOL forum, but not helpful enough for
me to tackle the problem. Probably I will have to admit that the WIMP is
too complex for me.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=147&group=comp.sys.acorn.programmer#147

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 31 May 2022 06:12:03 -0500
Date: Tue, 31 May 2022 12:12:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.1
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Content-Language: en-GB
Newsgroups: comp.sys.acorn.programmer
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
<59f119bd97Paul@sprie.nl>
From: nos...@hollypops.co.uk (Gerald Holdsworth)
Organization: Repton Resource Page
In-Reply-To: <59f119bd97Paul@sprie.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-AmrGAhSbhDVcw7sVxqkInDOzj+uVBdlzG61F1oR2oO/W5gdjpy2DEL6YkJgEv3Yn7Ee4EE3xCLjRYwK!J3MgvsbEgd6fr2WaKTlr4mnz0zj6dut+Ae1y/XmZYQxuhiUypoGy2CKLWFa3uoUb88u2mR2NxocM!fpanYUU6I8AIJ2UfDRUtkG9XuYY=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2621
 by: Gerald Holdsworth - Tue, 31 May 2022 11:12 UTC

On 31/05/2022 08:27, Paul Sprangers wrote:
> In article <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>,
> Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
>
>> RISC OS 5.29 may be able to handle, and convert, JPEGs natively. !Paint
>> can certainly import a JPEG and output a Sprite, and it can also export
>> a JPEG.
>
> Yes, I know. And both !ArtWorks and !DPlingScan can perfectly resize any
> bitmap as well. But the point is that I want to do it myself - or better: I
> don't want to force possible users of my program to be dependent of those
> (commercial) programs. And I want to figure out how those programs do it...
>
What I meant was that I'm sure that if !Paint can do this, then the RISC
OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a
wrapper around the OS_Sprite calls.

OS_Sprite 10 may be able to import a JPEG and convert to a Sprite for
you. I've had a play, but it was only brief. I need to look into it much
deeper.

Cheers,

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

Re: Reading the dimensions of a sprite or JPEG on disk

<59f133acfdNews03@avisoft.f9.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=148&group=comp.sys.acorn.programmer#148

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 31 May 2022 07:12:32 -0500
From: New...@avisoft.f9.co.uk (Martin)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 13:10:50 +0100
Message-ID: <59f133acfdNews03@avisoft.f9.co.uk>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk> <59f119bd97Paul@sprie.nl>
User-Agent: Pluto/3.19a (RISC OS/5.29) NewsHound/v1.54
Organization: None
Lines: 45
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ngtLjnsRjJuHkM253VlU89z49yKgjSVvK+QCCEdt2EaN7jl8/kg8AB1JFXcRTcETRABS3e1EJxy9xRt!/bhlm4PbHQ0JmhAuAcrNvua1Aa2WsDZnFNF2ckzK+SAlLnfQeBlfDc/ZeqTJHYLEuOpJ8uwhPaDB!gT4=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3074
 by: Martin - Tue, 31 May 2022 12:10 UTC

In article <59f119bd97Paul@sprie.nl>,
Paul Sprangers <Paul@sprie.nl> wrote:
> In article <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>,
> Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> > RISC OS 5.29 may be able to handle, and convert, JPEGs natively.
> > !Paint can certainly import a JPEG and output a Sprite, and it
> > can also export a JPEG.

> Yes, I know. And both !ArtWorks and !DPlingScan can perfectly
> resize any bitmap as well. But the point is that I want to do it
> myself - or better: I don't want to force possible users of my
> program to be dependent of those (commercial) programs. And I want
> to figure out how those programs do it...

> > I'd have a hunt around the RO5 PRMs to see if there is anything,
> > or post on the ROOL forums.

> I did find some related posts on the ROOL forum, but not helpful
> enough for me to tackle the problem. Probably I will have to admit
> that the WIMP is too complex for me.

I do not think it is the Wimp that is your problem.

Earlier you said...
> The images come from disk, typically photographs. So, not from a
> file, nor from another application.

.... but any image that is dragged from disc *is* a file!

I suspect your problem with sprites is that a sprite file can (and
usually does) contain several sprites. The information about each one
is scattered throughout the file - there is no handy list at the
beginning. So after a drag of a sprite file, you first have to find a
list of the sprites within, then the details of each one ... then
decide which one is required. Which probably entails loading the whole
file into memory.

This is unlike a jpeg file, which simply contains one jpeg.

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

Re: Reading the dimensions of a sprite or JPEG on disk

<59f13aedf2Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=149&group=comp.sys.acorn.programmer#149

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 15:30:04 +0200 (Custom)
Message-ID: <59f13aedf2Paul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net> <59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk> <59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk> <59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk> <59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!94.232.112.246.MISMATCH!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 22
Injection-Date: Tue, 31 May 2022 15:30:07 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: Paul Sprangers - Tue, 31 May 2022 13:30 UTC

In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> What I meant was that I'm sure that if !Paint can do this, then the RISC
> OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a
> wrapper around the OS_Sprite calls.

Ah, I see what you mean. But since I still have to scale the resulting
sprite, I could as well use the ChangeFSI function right away.

The routine does allow me to convert 2 or 3 small JPEGS, or 1 slightly
bigger JPEG, to the desired thumbnail before it runs out of memory. But
I've no idea how to manage extra workspace, nor do I have an idea how to
save the resulting sprite into an existing sprite file. Despite the quite
extensive documentation, I fail to understand the working of the function.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<59f13d9c35Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=150&group=comp.sys.acorn.programmer#150

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 15:59:20 +0200 (Custom)
Message-ID: <59f13d9c35Paul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk> <59f119bd97Paul@sprie.nl> <59f133acfdNews03@avisoft.f9.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 28
Injection-Date: Tue, 31 May 2022 15:59:23 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1951
 by: Paul Sprangers - Tue, 31 May 2022 13:59 UTC

In article <59f133acfdNews03@avisoft.f9.co.uk>,
Martin <News03@avisoft.f9.co.uk> wrote:

> I do not think it is the Wimp that is your problem.

Well, it's certainly not my *only* problem...

> I suspect your problem with sprites is that a sprite file can (and
> usually does) contain several sprites. [ ... ]

Actually I want to restrict myself to sprite files that contain just one
sprite. Since my program is meant to process photo's, JPEGs will be the
vast majority of the dragged files anyway.

The current problem (the one that blocks me from running into new ones) is
that I fail to handle the ChangeFSI function properly. The routine that I
have now does allow me to process some small JPEGs the way I want, before
it runs out of memory. I don't know how to increase its workspace, despite
the nice documentation, nor do I know how to save the resulting sprite into
an existing sprite file.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<59f145bf22chrisjohnson@spamcop.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=151&group=comp.sys.acorn.programmer#151

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 31 May 2022 10:45:05 -0500
From: chrisjoh...@spamcop.net (News)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 16:28:13 +0100
Message-ID: <59f145bf22chrisjohnson@spamcop.net>
References: <59f13d9c35Paul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.53-32 RC1
Organization: None
Lines: 11
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-nd45idAM0tu98oCqZyA2L4haZrX6qIow/JWyNHGR7ejfag0JjcKTWiQ9wfRYfYVjGq6r44u0IFXbZSL!+xqplHR2m64VKc2UJhFr3qYtSkUX2A8H4cG18YGqyV0cYQyaBt4mYSiRf7SaT5BCQ81VYoWmQmed!1EFq
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1319
 by: News - Tue, 31 May 2022 15:28 UTC

Paul

I am a bit confused as to how you are doing this. Are you in or out
of the desktop? You say in your early post that you drag a file to
your window. To me this suggests you are in the desktop. However, it
looks from the documentation I looked at that the function
FNChangeFSI is used from the command line. I am not sure whether it
can be used from a wimp program.

--
Chris Johnson

Re: Reading the dimensions of a sprite or JPEG on disk

<59f147dcf3chrisjohnson@spamcop.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=152&group=comp.sys.acorn.programmer#152

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 31 May 2022 10:51:29 -0500
From: chrisjoh...@spamcop.net (News)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 16:51:20 +0100
Message-ID: <59f147dcf3chrisjohnson@spamcop.net>
References: <59f13d9c35Paul@sprie.nl> <59f145bf22chrisjohnson@spamcop.net>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.53-32 RC1
Organization: None
Lines: 8
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-8uCTb3mX4KV8ot3UxEQsnr2TzZNkThvmVhcPkR1GK8u+0ovT87N3GedMiSnKXkz6u+jhhSqlLu+GIBt!Nj+9d3ddXAZxpzzJXRKBQ2Trx+fIR4wcvSw2FeiESstg22pSg1nEwUSd8kvTFQm71KznUaaUJGOo!Fkia
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1154
 by: News - Tue, 31 May 2022 15:51 UTC

In article <59f145bf22chrisjohnson@spamcop.net>,
News <chrisjohnson@spamcop.net> wrote:
> used from the command line

.... or a single tasking binary (it mentions F12).

--
Chris Johnson

Re: Reading the dimensions of a sprite or JPEG on disk

<59f14bbfafPaul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=153&group=comp.sys.acorn.programmer#153

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 31 May 2022 18:33:46 +0200 (Custom)
Message-ID: <59f14bbfafPaul@sprie.nl>
References: <59f13d9c35Paul@sprie.nl> <59f145bf22chrisjohnson@spamcop.net>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!94.232.112.246.MISMATCH!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 18
Injection-Date: Tue, 31 May 2022 18:33:51 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: Paul Sprangers - Tue, 31 May 2022 16:33 UTC

In article <59f145bf22chrisjohnson@spamcop.net>,
News <chrisjohnson@spamcop.net> wrote:

> However, it looks from the documentation I looked at that the function
> FNChangeFSI is used from the command line. I am not sure whether it can
> be used from a wimp program.

Yes, it can. Near the bottom of the document in question is a description
of how to use it in a BASIC (Wimp) program (FNChangeFSI is even exclusively
intended for BASIC programs). And it does work indeed, as I described in
previous posts, but not always and probably not the way it should.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=154&group=comp.sys.acorn.programmer#154

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 31 May 2022 15:51:45 -0500
Date: Tue, 31 May 2022 21:51:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.1
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Content-Language: en-GB
Newsgroups: comp.sys.acorn.programmer
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
<59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
<59f13aedf2Paul@sprie.nl>
From: nos...@hollypops.co.uk (Gerald Holdsworth)
Organization: Repton Resource Page
In-Reply-To: <59f13aedf2Paul@sprie.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-2O6SfKFcbanc0G+lvtpneQQkclN4AMm1IIMA4DgJnnQPe3STviCl8DpIfriOWK09nRkfEORgqmiO2V9!21nH+4oggMyqZXaVdvn9AQneuvo8x5Mat0zt5SOySnPPt6YyKilI/9razB+Msw6QyJHmOL+Q4MK9!yUI9DHL8NvLCPqcfbrGuAFUA8nE=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2696
 by: Gerald Holdsworth - Tue, 31 May 2022 20:51 UTC

On 31/05/2022 14:30, Paul Sprangers wrote:
> In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
> Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
>
>> What I meant was that I'm sure that if !Paint can do this, then the RISC
>> OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a
>> wrapper around the OS_Sprite calls.
>
> Ah, I see what you mean. But since I still have to scale the resulting
> sprite, I could as well use the ChangeFSI function right away.
>

OS_SpriteOp 52 paints a scaled sprite onto the screen. I can't see any
calls to rescale a sprite as a new sprite in the area.

Incidentally, if you wanted to see how many sprites are in a file
without loading the entire file, just look at the first four bytes -
this is the total number of sprites in the file. This is different to a
sprite area where the area size is the first four bytes, then the number
of sprites.

Unless you fancied writing your own scaling routine...

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

Re: Reading the dimensions of a sprite or JPEG on disk

<mpro.rcrqgg03qsdop0379.news@stevefryatt.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=155&group=comp.sys.acorn.programmer#155

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!wUBOHGVSkkz9PTvSBH1HKg.user.46.165.242.75.POSTED!not-for-mail
From: new...@stevefryatt.org.uk (Steve Fryatt)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Date: Tue, 31 May 2022 23:29:10 +0100
Organization: Aioe.org NNTP Server
Lines: 18
Message-ID: <mpro.rcrqgg03qsdop0379.news@stevefryatt.org.uk>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
<59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
<59f13aedf2Paul@sprie.nl> <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>
Content-Type: text/plain; charset=us-ascii
Injection-Info: gioia.aioe.org; logging-data="13355"; posting-host="wUBOHGVSkkz9PTvSBH1HKg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/2.73.6.4252 (Qt/5.12.8) (Linux-x86_64)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Steve Fryatt - Tue, 31 May 2022 22:29 UTC

On 31 May, Gerald Holdsworth wrote in message
<Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>:

> Incidentally, if you wanted to see how many sprites are in a file without
> loading the entire file, just look at the first four bytes - this is the
> total number of sprites in the file. This is different to a sprite area
> where the area size is the first four bytes, then the number of sprites.

A much easier, and clearer, way to express that is:

A sprite area is a block of memory where the first word contains the size of
the block, followed by the contents of a sprite file starting from the
second word.

--
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

Re: Reading the dimensions of a sprite or JPEG on disk

<mpro.rd434c00756yg00vg.spamtrap@mw-software.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=156&group=comp.sys.acorn.programmer#156

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!+UmLVgfhzwxnLo4PsVnEsQ.user.46.165.242.75.POSTED!not-for-mail
From: spamt...@mw-software.com (Martin Wuerthner)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Date: Tue, 7 Jun 2022 16:33:48 +0200
Organization: MW Software
Lines: 34
Message-ID: <mpro.rd434c00756yg00vg.spamtrap@mw-software.com>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
<59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
<59f13aedf2Paul@sprie.nl> <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>
Content-Type: text/plain; charset=us-ascii
Injection-Info: gioia.aioe.org; logging-data="37295"; posting-host="+UmLVgfhzwxnLo4PsVnEsQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/2.73.6.4250 (Qt/5.6.3) (Windows-10)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin Wuerthner - Tue, 7 Jun 2022 14:33 UTC

Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> On 31/05/2022 14:30, Paul Sprangers wrote:
> > In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
> > Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
> >
> > > What I meant was that I'm sure that if !Paint can do this, then the
> > > RISC OS SWI calls can probably do it. I.e., I'm wondering if !Paint is
> > > just a wrapper around the OS_Sprite calls.
> >
> > Ah, I see what you mean. But since I still have to scale the resulting
> > sprite, I could as well use the ChangeFSI function right away.
> >
>
> OS_SpriteOp 52 paints a scaled sprite onto the screen. I can't see any
> calls to rescale a sprite as a new sprite in the area.

The way this is usually done is to create a new sprite in the area (or some
other area), redirect output to it via OS_SpriteOp 60 and then use
OS_SpriteOp 52 (or 56 using a matrix) to plot the original sprite scaled
into your new sprite.

Be careful when using SpriteOp 60. Never forget to switch output back to the
screen, and if your code crashes while output is switched, you will usually
have to reboot.

In terms of quality you are much better off using ChangeFSI, since SpriteOp
52 scales down in a very naive way, which causes massive aliasing effects,
while ChangeFSI interpolates between pixel values and uses error diffusion.

--
Martin Wuerthner MW Software http://www.mw-software.com/

------- RISC OS Software for Design, Printing and Publishing --------

Re: Reading the dimensions of a sprite or JPEG on disk

<59f6c11f76Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=157&group=comp.sys.acorn.programmer#157

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 11 Jun 2022 08:56:49 +0200 (Custom)
Message-ID: <59f6c11f76Paul@sprie.nl>
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net> <59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk> <59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk> <59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk> <59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk> <59f13aedf2Paul@sprie.nl> <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk> <mpro.rd434c00756yg00vg.spamtrap@mw-software.com>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 26
Injection-Date: Sat, 11 Jun 2022 08:56:56 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2172
 by: Paul Sprangers - Sat, 11 Jun 2022 06:56 UTC

In article <mpro.rd434c00756yg00vg.spamtrap@mw-software.com>,
Martin Wuerthner <spamtrap@mw-software.com> wrote:

> In terms of quality you are much better off using ChangeFSI, since
> SpriteOp 52 scales down in a very naive way, which causes massive
> aliasing effects, while ChangeFSI interpolates between pixel values and
> uses error diffusion.

I can confirm that. ChangeFSI does a very good job from within a BASIC
program, but not by using its library function as described in the
documentation. At least, I certainly failed to get it working. Using the
command line instruction however, and start that as a Wimp_Task, did the
trick. No need to mess with local memory blocks or sprite areas or
whatever. It rescales every JPEG, no matter how large, to the desired
dimension, quickly and transparently.

Now that this problem has been solved, I'm running into a new one. But
that's for another thread.. Thank you for all your thoughts and
suggestions.

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Reading the dimensions of a sprite or JPEG on disk

<109b3322-472a-4ed3-8805-de19a6fed014n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=158&group=comp.sys.acorn.programmer#158

  copy link   Newsgroups: comp.sys.acorn.programmer
X-Received: by 2002:a37:ef12:0:b0:6a6:b664:330d with SMTP id j18-20020a37ef12000000b006a6b664330dmr25153263qkk.152.1655046952806;
Sun, 12 Jun 2022 08:15:52 -0700 (PDT)
X-Received: by 2002:a05:620a:c4a:b0:6a6:6d3b:f0e8 with SMTP id
u10-20020a05620a0c4a00b006a66d3bf0e8mr35701066qki.785.1655046952654; Sun, 12
Jun 2022 08:15:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.acorn.programmer
Date: Sun, 12 Jun 2022 08:15:52 -0700 (PDT)
In-Reply-To: <59f6c11f76Paul@sprie.nl>
Injection-Info: google-groups.googlegroups.com; posting-host=92.17.176.145; posting-account=9eZ2eAkAAAC9rw6FatUdLCvE_krF0ksY
NNTP-Posting-Host: 92.17.176.145
References: <59ef9cf586Paul@sprie.nl> <59ef9fa796chrisjohnson@spamcop.net>
<59efa0a626Paul@sprie.nl> <ReWdnVLwIJhwvw__nZ2dnUU7-f2dnZ2d@brightview.co.uk>
<59f0aeac8aPaul@sprie.nl> <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>
<59f0be8a9aPaul@sprie.nl> <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>
<59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>
<59f13aedf2Paul@sprie.nl> <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>
<mpro.rd434c00756yg00vg.spamtrap@mw-software.com> <59f6c11f76Paul@sprie.nl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <109b3322-472a-4ed3-8805-de19a6fed014n@googlegroups.com>
Subject: Re: Reading the dimensions of a sprite or JPEG on disk
From: new...@sprow.co.uk (Sprow)
Injection-Date: Sun, 12 Jun 2022 15:15:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Sprow - Sun, 12 Jun 2022 15:15 UTC

On Saturday, June 11, 2022 at 7:56:59 AM UTC+1, Paul Sprangers wrote:
> In article <mpro.rd434c0075...@mw-software.com>,
> Martin Wuerthner <spam...@mw-software.com> wrote:
>
> > In terms of quality you are much better off using ChangeFSI
[...]
> I can confirm that. ChangeFSI does a very good job from within a BASIC
> program, but not by using its library function as described in the
> documentation. At least, I certainly failed to get it working. Using the
> command line instruction however, and start that as a Wimp_Task, did the
> trick. No need to mess with local memory blocks or sprite areas or
> whatever. It rescales every JPEG, no matter how large, to the desired
> dimension, quickly and transparently.

One tip and one bear trap with calling FNChangeFSI when JPEGs are involved:

First, in the 'CmdBasUse' document in the section immediately below where it describes how to use FNChangeFSI, there are descriptions of some system variables you can (optionally) set. In particular if you make ChangeFSI$Cache larger than the source image it'll be loaded into RAM and processed much quicker.

The bear trap with a few image types (certain JPEGs, BTPC images, & PhotoCDs at a quick look in ChangeFSI 1.66) is the source image may be passed to a helper application to do the processing. That helper program will displace your calling program in BASIC which is also in the application slot so never returns. This can be avoided by using the *ChangeFSI alias to launch it in a separate Wimp task and collect the result,
Sprow.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor