Re: [Webgenerator-x-devs] Image class
Brought to you by:
gregni
|
From: Slava M. <sm...@in...> - 2002-05-02 15:23:37
|
Firstly I would prefer to see WG-X more structured.
Ie I suggest to create the (I?)File class, then use it's possibilities while
using IImage.
The tasks of (I)File are (draft, of course):
1.File upload.
- output of input field and upload btn to forms.
- defining a path in the server directory structure where we need to store
this file, dependent on module and page calling the upload.
- defining new filename for the file to store.
- registering the path/filename/extension and other important information
about this file on a file repository by unique ID. The repository is cfile
and cfile_data.
We could use a single entry in cfile for new version of WG-X, and 2 its
modifications with tar.gz and zip extensions in cfile_data.
We could have a title field in the cfile table as ID to the ctext table.
We could use a single entry in the cfile for someimage file with a title
stored here, and its modifications with different sizes in the cfile_data
table.
We could have a description field in the cfile_data table designated to
store important info about the file via some standartized way. Ie if it's a
graphics then we write eg "100*100" here, if it's a zip or pdf file to
download we can write nothing here. Better to have here a separate field for
extensions to sort and search them easily.
Finally:
{cfile}
fid, title, owners(modules)
{cfile_data}
fiid, fid, localpath, filename, ext, desc, (abbrev).
If we have such a repository then we could use one image many times choosing
them from repository lists.
After saving a file info into repository any files may be saved on the
server with names composed by file ID from the repository.
...
2.File download
3.Display link to file
4.Display file. For images, txt, html, pdfs...
5.Common Add, Edit, Delete file methodes.
Add: default - display filebox to upload.
Add: if file to add is an image, then add selectbox to choice an image from
repository to resize.
Edit: to replace file by another.
6.!!!Other form to display CFile (not IText form) to current fid.
To add we have to place at the bottom an upload block and sometimes
selectbox to choose from repository.
If the current fid has fiid's (items id's) then display a list of filenames
with upload blocks to replace this file by another, the Delete btn.
If the current fid refers to image then display an image near the filename.
Due to this we will have complete control on any files.
Now about images.
Any graphic file (independently on we wish resize it or not) has to be store
on the server. A (C)File class could help here. We must store
this file as original to make later as more resizings as we wish.
If we can't do resizing (there is no GD, or GD functions not works) then we
have still possibility to use any images.
If we have GD working, new resized file created, then we have to store the
new image info to cfile_data as well
as the original image is stored here. Once new size is got one times, then
GD has not to work second or third time.
The main is a methodes specific to work with images only has to be in the
IImage class.
A methodes which are common to all files has to be placed in the CFile
class.
The tasks to IImage:
1.Define if system is GD-compatible.
2.Image resizing dependent on type of image.
3.Image auto creation functions may be here, based on data from DB, to
create a diagrams, etc.
That's all.
Kill two animals by one shot!
By the way I have not GD extensions installed on my local system.:) Although
good providers always has.
I think, much more important to make good (C)File class now.
Giorgio, you know how to make this quickly.:) Almost such as IText.
----- Original Message -----
From: <web...@li...>
To: <web...@li...>
Sent: Tuesday, April 30, 2002 12:17 AM
Subject: Webgenerator-x-devs digest, Vol 1 #10 - 1 msg
> Today's Topics:
>
> 1. Image class (Webgenerator-X)
>
> --__--__--
>
> Message: 1
> Date: Mon, 29 Apr 2002 10:42:54 +0200
> From: Webgenerator-X <pos...@we...>
> To: web...@li...
> Subject: [Webgenerator-x-devs] Image class
>
> Hi,
>
> Before releasing the RC1, We need some informations about what a Image
> Interface class should do.
> This Image class will behave much like IText (multilingual support
> transparent in all module).
>
> The questions are:
> - image upload ?
> - image resize/edit using GD ?
> What is the pourcentage of people with GD installed ?
> - same image with different size support ?
>
> I am waiting for all your suggestions in this mailing list,
> Giorgio
>
>
>
>
|