Skip to main content
Topic: Attachment (thumbnails) (Read 1958 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Attachment (thumbnails)

Doing some work and working with images and S3 got me thinking about attachments in Elkarte.

I don't see the need or use of storing thumbnails in the database. If an attachment has a thumbnail, just name it "{id}_thumb". What is common for thumbnails is to store the size of the thumbnail in the name: "{id}_thumb_60x60" if the id can contain underscores (I don't think it can) just add more of them or use dots: "{id}.thumb_60x60"

Then you can remove a lot of the stuff to check for the type.

I am up in the air about a separate table for the avatars. If you remove the type, just make id_msg = 0 and then it is an avatar.

In a future version I am going to change the attachment uploader to be a service with adapters so you can change the upload service to normal PHP upload, FTP upload (as plugin), S3 (as plugin), DB (as plugin) or any other kind of service out there. Say you have three PHP servers. You could mirror the uploads to all 3 or you could have all 3 upload to a single file server. Probably just use Gaufrette for that. In addition, each validation check would be a different class that you'd add to the checks on upload.

 

Re: Attachment (thumbnails)

Reply #1

Why did I lost that one?
It does really make a lot of sense to me.
Bugs creator.
Features destroyer.
Template killer.