Multiple versions of a image file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple versions of a image file

Ronaldo Ferraz
Hi,

First time posting here, so I figure I should thank all the people
behind Seaside and this list. You are making Web development
interesting and fun to me again. I'm evangelizing Seaside as strongly
as I can here in Brazil, but I guess my Rails past is not helping
much. I'll get there, though. :-)

Anyway, I'm using Magritte to implement an application and I'd like to
automatically generate version of an image file as soon as its upload.
My first thought has been to change MAFileModel to support that and
propagate the support to its subclasses, and change MAFileDescription
to support a new attribute called versions or something like that. Is
that a good path, or is there is something already that I should use?

Thanks for the help.

Regards,

--
Ronaldo Ferraz
http://logbr.reflectivesurface.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Multiple versions of a image file

Lukas Renggli
> Anyway, I'm using Magritte to implement an application and I'd like to
> automatically generate version of an image file as soon as its upload.
> My first thought has been to change MAFileModel to support that and
> propagate the support to its subclasses, and change MAFileDescription
> to support a new attribute called versions or something like that. Is
> that a good path, or is there is something already that I should use?

It depends if you want to version files also in other situations. If
this is the only case then it is certainly simpler just to have
specific accessors in your model:

MyModel>>imageFile: aFileModel
     imageFileVersions add: aFileModel

MyModel>>imageFile
     ^ imageFileVersions isEmpty ifFalse: [ imageFileVersions last ]

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Multiple versions of a image file

Ronaldo Ferraz
Lukas,

Thanks for the quick reply. I guess I didn't express myself well when
I used the word "versions". By versions I meant diferent
representations, like thumbnails, for example. Currently, I'm
generation them on-the-fly, but I'd like to keep then on the disk to
make use of Apache static file support.

Sorry about the confusion and thanks again for the reply.

Regards,

Ronaldo

On 2/16/08, Lukas Renggli <[hidden email]> wrote:

> > Anyway, I'm using Magritte to implement an application and I'd like to
> > automatically generate version of an image file as soon as its upload.
> > My first thought has been to change MAFileModel to support that and
> > propagate the support to its subclasses, and change MAFileDescription
> > to support a new attribute called versions or something like that. Is
> > that a good path, or is there is something already that I should use?
>
> It depends if you want to version files also in other situations. If
> this is the only case then it is certainly simpler just to have
> specific accessors in your model:
>
> MyModel>>imageFile: aFileModel
>      imageFileVersions add: aFileModel
>
> MyModel>>imageFile
>      ^ imageFileVersions isEmpty ifFalse: [ imageFileVersions last ]
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
Ronaldo Ferraz
http://logbr.reflectivesurface.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Multiple versions of a image file

Lukas Renggli
> Thanks for the quick reply. I guess I didn't express myself well when
> I used the word "versions". By versions I meant diferent
> representations, like thumbnails, for example. Currently, I'm
> generation them on-the-fly, but I'd like to keep then on the disk to
> make use of Apache static file support.

In this case a new subclass of MAFileModel is probably the easiest way
to go (I did something similar for a commercial project). You can tell
the file-description to use a different file-model class using the
#kind: accessor.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Multiple versions of a image file

Ronaldo Ferraz
Hi, Lukas--

Thanks again for the reply. Subclassing really seems better than
changing a core class.

By the way, Magritte rocks. :-)

Regards,

Ronaldo

On Feb 16, 2008 5:38 PM, Lukas Renggli <[hidden email]> wrote:

> > Thanks for the quick reply. I guess I didn't express myself well when
> > I used the word "versions". By versions I meant diferent
> > representations, like thumbnails, for example. Currently, I'm
> > generation them on-the-fly, but I'd like to keep then on the disk to
> > make use of Apache static file support.
>
> In this case a new subclass of MAFileModel is probably the easiest way
> to go (I did something similar for a commercial project). You can tell
> the file-description to use a different file-model class using the
> #kind: accessor.
>
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



--
Ronaldo Ferraz
http://logbr.reflectivesurface.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside