Re: JPEG Metadata Package

From: Date: Mon, 05 May 2003 21:34:29 +0000
Subject: Re: JPEG Metadata Package
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15918@lists.php.net to get a copy of this message
It seems to me that a JPEG file is composed of an aggregate of Image_IPTC and Image_EXIF. It seems wrong to inherit Image_TIFF from Image_JPEG. Note that Image_IPTC does not require the PHP user to have to recompile PHP for exif support (--enable-exif) - it works with a default out-of-the-box installation. It might be better to have an Image_Metadata class from which Image_IPTC and Image_EXIF inherit, however, since both must use imagegetsize() and both probably have a commit() or save() method of some sort. This would, of course, change our class names to the names of: Image_Metadata_IPTC Image_Metadata_EXIF It would seem to me also, that an Image_JPEG class when then have the ability to include those classes and create a composition of both. The same would be true of a TIFF and perhaps a PSD file.
That is true... but it's an implementation detail. You could break it in: - Image_Structure_JPEG - Image_Structure_TIFF - Image_Structure_Adobe - Image_Metadata_IPTC - Image_Metadata_EXIF And then mix and match the modules you need... but in 99% of the cases, the users will only care about Image_JPEG. I'm not saying that in the future, breaking it in the 5 components listed above would not be a good idea. It would be perfect. But I don't think that right now it's worth all the effort. I rather have Image_JPEG now, and perhaps Image_TIFF in the near future... and only then would I care about breaking it into the component parts. And I think calling the module Image_JPEG would make it easier to break it in the future, since it provides a public facade that would remain the same.

« previous php.pear.dev (#15918) next »