[Typo3-dev] introducing the fileConversion service

René Fritz r.fritz at colorcube.de
Tue Jan 11 15:29:09 CET 2005


> >
> > subtype naming:
> >
> > how abot "from:to"? A colon is an unlikely character to appear in a file
> > format. And I'd drop the three char conventoin. So something like
> > "bz2:gzip" would be valid.

I know that services do not fit very well with 2d matrixes of subtypes.
That means for every combination of file conversation you have to register a 
new subtype. That could be very much.

Therefore I suggest (as Robert and I already talked about) to use a service 
type for file conversation and another for image conversation which work 
different.


file conversation:

Type (defines destination format): convertTo:html
Subtypes (source formats): txt,doc,pdf,csv

I assume that we will have less destination formats than source format. This 
way we will have a much smaller registration array for the services.


image conversation:

Type: convImg
Subtypes (source AND dest formats): png,jpg,tiff,...

I assume that an image conversion service can write mostly all formats that it 
can read.
The API of t3lib_extmgm::findService() can be changed so you can pass more 
than one subtypes to find a service.
Then you will call

$imgSv = t3lib_extmgm::findService('convImg', 'png,gif');

That will find a service registered for png AND gif as subtype.
Then there should be a function in the convImg API to check if the direction 
is really possible:

if ($this->convAvail($sourcFormat, $destFormat)) {

The convImg have to be able to handle parameters like imageMagick can do.


The file conversion service could work like convImg too, but I'm not sure if 
it's needed.


> > "filePath" will mean a path to a file to read from. How about making
> > this a "url"? So we could read from arbitrary sources not just the
> > filesystem.

The class supports all what fopen() allows. That means reading from http:// 
shouldn't be a problem, but I haven't tested that.

Maybe writing will work also? ftp://user:password@example.com/

R

-- 
COLORCUBE
digital media lab

www.colorcube.de




More information about the TYPO3-dev mailing list