attachinary
attachinary copied to clipboard
How do I store per-image meta data with my attachinary files?
I would like to store per-photo metadata with each file. Reasons like the following:
- I would like to set one photo within a group to be the "primary" photo, without necessarily reordering the photos.
- I would like to be able to rotate a photo 90 degrees, and have that rotation always applied in every view of the photo.
- I would like to set the cropping preference on a per-photo basis. Sometimes I have seen that crop: :faces doesn't gracefully degrade to :face or to :thumb
Possibly there are other things too, and I want to know how you would generally approach these issues, if you have another idea. My only thought was to store some meta info with each attachinary object.
If I understood you well, you want to store metadata in database, so that you can read from it when applying later transformations, right?
I'm afraid that something like that can't be done out of the box. What you can do is add extra blob column to attachinary_files table, and store the metadata in it. Reading and writing to this table must be done manually.
hope that helps
https://github.com/assembler/attachinary/issues/60#issuecomment-22161906