[TYPO3-dev] GIFBUILDER Caching-Scheme for Extension

Felix Buenemann Felix.Buenemann at gmx.de
Wed Jul 2 11:07:27 CEST 2008


Hello Martin,

Martin Kutschker schrieb:
> Felix Buenemann schrieb:
>> Hello,
>>
>> I am currently coding on an extension that uses GIFBUILDER from PHP to
>> create a thumbnail-gallery of random project records. Currently the
>> thumbnails are regenerated on every page load.
>
> Why? How do you generate them? If you use an IMAGE TS object the image
> will be cached.

I did some more research and now I see that the images are cached, I was 
not seing this before because I was using a lot of duplicated entries 
int he database which also created duplicates of the images. Now working 
with a small dataset I can see it is doing caching.

However only images are cached, but I also create GIFBUILDER text 
objects as overlays displayed by a javascript mouseover. These overlays 
are only generated once where needed per page (i.e. if i have the same 
record displaying two times, it'll use the same text overlay graphic), 
but if I reload the page, those overlay get regenerated.
So how can I make use of caching for those GIFBUILDER text graphics 
aswell (they contain part of the title attribute from the record).

Also I noticed that format attribute is ignored when creating gifbuilder 
objects from PHP, they always match the input file format, using code like:

$ts['img'] = 'IMAGE';
$ts['img.']['file'] = $imgFullPath;
$ts['img.']['file.']['format'] = 'jpg';
$ts['img.']['file.']['quality'] = 85;
$ts['img.']['file.']['width'] = '107c';
$ts['img.']['file.']['height'] = '107c';
$thumbnailImg = $this->cObj->IMAGE($ts['img.']);

(resulting thumb: gif=>gif, jpg=>jpg,png=>png)

This is using Typo3 4.2.1.

>
> Masi

Best Regards,
    Felix Buenemann






More information about the TYPO3-dev mailing list