dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Meta data missing magic attributes

Open antulik opened this issue 10 years ago • 3 comments

Readme says:

"Furthermore, any magic attributes you add a field for will be added to the meta data for that attachment, so can be used to set custom response headers when Dragonfly serves the content."

when i access meta in my processor my meta data only has model_attachment, model_class and name fields. Columns like width and height are not present.

Am i missing anything?

antulik avatar Nov 27 '15 02:11 antulik

it seems like magic attributes are not stored in meta data file

antulik avatar Nov 27 '15 04:11 antulik

hmm looks like I removed it actually https://github.com/markevans/dragonfly/commit/dcae2e3 which means that doc is out of date. Out of interest, what do you need it for? In the meantime you can add them manually if you wish using add_meta

markevans avatar Nov 28 '15 14:11 markevans

I did want to implement crop processor, which would automatically fetch crop sizes from the model and use those in cropping.

After i've failed to make use of metadata I've discovered define function which would be run before request, which worked better.

But after i've done all of that i've realised some things:

  • for such common usecase as cropping image it's not obvious how to define shortcut in dragonfly. Perhaps example would be very handy.
  • after trial and error I still have no idea how to update meta-data for an existing image. I could not make changes to persist.
  • it's not clear how to make use of metadata, should there be an option what metadata to attach to the job or updating metadata (see above)

antulik avatar Dec 01 '15 01:12 antulik