[TYPO3] Scale gifbuilde image

Christopher Torgalson bedlamhotel at gmail.com
Sun Dec 10 17:56:43 CET 2006


Hi Tapio,

On 12/10/06, Tapio Markula <tapio.markula at atwebteam.com> wrote:
>
> In the page
> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/9/2/
>
> SCALE:
> NOTE:  This object resets workArea to the new dimensiosn of the image!
>
> Property:
>
> Data type:
>
>
> Description:
>
> Default:
> width
>
> pixels + calc
>
> height
>
> pixels + calc ?????????????
>
> params
>
> ImageMagickParams
>
> [tsref:->GIFBUILDER.(GBObj).SCALE]
>
> That is extremely minimal info - I don't figure at all what to do.
> Could someone give some glue?
>
> I tried
> page.2 = HMENU
> page.2.1 = GMENU
> page.2.1 {
> 1=SCALE {
>    20 = TEXT
>    20.text.field = title
>    offset = 0,17
>    align = center
>
>    NO {
>    3 = IMAGE
>    3.file = {$buttonImagePath}leftGrayBW.gif
>    3.offset=0,0
>
>    5 = IMAGE
>    5.file = {$buttonImagePath}middleGrayBW.gif
>    5.tile =10000,1
>    5.offset=10,0
>
>    6 = IMAGE
>    6.file = {$buttonImagePath}rightGrayBW.gif
>    6.offset=10+[20.w],0
>
>    XY = [20.w] +20,22
>    20 = TEXT
>    20.text.field = title
>    20.offset = 0,16
>    20.align = center
>    20.fontColor = black
>    20.niceText=1
>    20.fontSize = 14
>    wrap=<br>|
>    20.fontFile = {$fontPath}ARIAL.TTF
>    }
> 1.value = height=20,70
> }
> }
> that doesn't work and because of missing proper documentation I'm lost
> without any example


I guess you're trying to scale the image to 20 x 70 pixels? All you
really need to understand is that SCALE is a gifbuilder object like
TEXT etc--it works exactly the same way as all the other items in that
section of GIFBUILDER. So from your sample above, remove the line
'1=SCALE {' , the corresponding '}' and '1.value = height=20,70'.

Then, add something like this:

page.2.1.50 = SCALE
page.2.1.50 {
    width = 70
    height = 20
}


Note that like GIFBUILDER's XY property, scale has 'calc', so that if
you want to, you should be able to explicitly connect the size after
scaling to the original size:

## Set the initial size of the GIFBUILDER object:
XY = [20.w] +20,22
...
...
...
## Set the final size to half the original size:
50 = SCALE
50 {
    width = [20.w]/2+10
    height = 11
}





--CT


More information about the TYPO3-english mailing list