[REBOL] Re: image resizing
From: volker:nitsch:gmai:l at: 8-Jun-2006 10:21
On 6/8/06, sags-apollo.lv <sags-apollo.lv> wrote:
> Thanks, Volker!
>
> I already noted in some examples and scripts this notation:
>
> command/function variable: value
>
> I never used it so it is a bit confusing for me.
> Are there any a little bit detailed information about this way?
> When it can/should be used what kind of functions can do that?
>
its a shortcut.
save/png bin: #{} to-image layout[size 5x5]
is the same as
bin: #{}
save/png #{} to-image layout[size 5x5]
You can do assignments in expressions,
>> sum: 1 + prod: 2 * 3
== 7
>> sum
== 7
>> prod
== 6
and i sometimes use that.
(btw it should be "copy #{}", forgot the copy)
> Thanks in advance!
>
> Janeks
>
> On 8 Jun 2006 at 0:27, Volker Nitsch wrote:
>
> >
> > On 6/7/06, sags-apollo.lv <sags-apollo.lv> wrote:
> > >
> > > Hi!
> > >
> > > Is it possible to do image resizing for browser output without
> > > saving it to file?
> > >
> > > Example script:
> > >
> > > print "Content-Type: image/png^/"
> > >
> > > jpg: read/binary %/C/WWW/ROOT/rebol/IMG_4364.JPG
> > >
> > > t1: load jpg
> > >
> > > newsize: t1/size / 4
> > >
> > > outl: layout [
> > > size newsize
> > > backdrop t1
> > > ]
> > > ; how to get rid of saving to file?
> > > out-image: to-image outl
> > > save/png %out-image.png out-image
> > >
> > > png: read/binary %out-image.png
> > >
> > > write-io system/ports/output png length? png
> > >
> >
> > You can save to binaries.
> >
> > >> save/png bin: #{} to-image layout[size 5x5]
> > >> length? bin
> > == 103
> > >> ? bin
> > BIN is a binary of value: #{
> > 89504E470D0A1A0A0000000D4948445200000005000000050802000000020DB1
> > B20000001374455874536F667477617265005245424F4C2F566965778FD91678
> > 0000000F49444154789C6338810A1828E4030028973A99450E58C10000000049
> > 454E44AE426082
> > }
> >
> > >
> > > brgds
> > > Janeks
> > > --
> > > To unsubscribe from the list, just send an email to
> > > lists at rebol.com with unsubscribe as the subject.
> > >
> > >
> >
> >
> > --
> > -Volker
> >
> > "Any problem in computer science can be solved with another layer
> > of
> > indirection. But that usually will create another problem." David
> > Wheeler
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
-Volker
Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem.
David
Wheeler