attachinary icon indicating copy to clipboard operation
attachinary copied to clipboard

How do I store per-image meta data with my attachinary files?

Open timothyjoh opened this issue 12 years ago • 2 comments

I would like to store per-photo metadata with each file. Reasons like the following:

  1. I would like to set one photo within a group to be the "primary" photo, without necessarily reordering the photos.
  2. I would like to be able to rotate a photo 90 degrees, and have that rotation always applied in every view of the photo.
  3. 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.

timothyjoh avatar May 28 '13 13:05 timothyjoh

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

assembler avatar May 30 '13 07:05 assembler

https://github.com/assembler/attachinary/issues/60#issuecomment-22161906

maletor avatar Aug 06 '13 07:08 maletor