publiclab / mapknitter

Upload your own aerial images, position (rubbersheet) them in a web interface over existing map data, and share via web or composite and export for print.
http://mapknitter.org
GNU General Public License v3.0
267 stars 207 forks source link

Version tracking of images #682

Closed divyabaid16 closed 5 years ago

divyabaid16 commented 5 years ago

Description Images can be updated by the users and the history of all the images must be stored. The latest version of the image must be shown up.

Something similar to the GitHub comments: Selection_172

Image versioning, locking, and reverting must be possible.

Thanks!

jywarren commented 5 years ago

Hi @divyabaid16 are you looking to plan this one out a bit? One thing you could do is look at another system in Rails that has versioning. For example our node model in plots2 has "revisions" which are stored in a second table: https://github.com/publiclab/plots2/blob/master/app/models/node.rb

https://github.com/publiclab/plots2/blob/master/app/models/revision.rb

Potentially a second table could be used to store timestamped corner location data for each image?

jywarren commented 5 years ago

Let's map out how it's done currently -- aha, actually we use the Node table:

https://github.com/publiclab/mapknitter/blob/3588ccd8b2510472d6aa73328fbf37f865f3f596/app/controllers/images_controller.rb#L73-L97

Perhaps we need to add a "version" column to that table, and then we can fetch the associated nodes using that, instead of using a concatenated list like 1,2,3,4 the way we do here:

https://github.com/publiclab/mapknitter/blob/3588ccd8b2510472d6aa73328fbf37f865f3f596/app/controllers/images_controller.rb#L92

Here's where we currently fetch the nodes for an image (called a Warpable): https://github.com/publiclab/mapknitter/blob/3588ccd8b2510472d6aa73328fbf37f865f3f596/app/models/warpable.rb#L127-L129

jywarren commented 5 years ago

Hi @divyabaid16, looking ahead to this - I think it'll make some really interesting things possible, like opening an image in image-sequencer and saving the output as a new version! That'll let people fix lens distortion (the fisheye effect) or do brightness or contrast fixes on their images. What do you think of this idea?

jywarren commented 5 years ago

Like the ndvi button right now doesn't save at all. It just replaces images temporarily. But a versioning system could actually save the output but allow reverting it too!

divyabaid16 commented 5 years ago

I was looking into this and found that we can also use the "paper_trail" gem to track versions of records. https://github.com/paper-trail-gem/paper_trail This is different from that used in plots2. What are your views in this? @jywarren @gauravano

jywarren commented 5 years ago

hm, cool! Great find! Do you think it's pretty simple to use and integrate? If so, i think that could work!

On Mon, Jul 15, 2019 at 2:14 AM Divya Baid notifications@github.com wrote:

I was looking into this and found that we can also use the "paper_trail" gem to track versions of records. https://github.com/paper-trail-gem/paper_trail This is different from that used in plots2. What are your views in this? @jywarren https://github.com/jywarren @gauravano https://github.com/gauravano

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/mapknitter/issues/682?email_source=notifications&email_token=AAAF6J63RGMRNLBX3CWKYR3P7QIRBA5CNFSM4HXBANTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4ZKDI#issuecomment-511284493, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF6J34GL5E3WSTRVCQLL3P7QIRBANCNFSM4HXBANTA .

grvsachdeva commented 5 years ago

Paper_trail is good but let's consider all the cases we need to handle. If paper_trail can do it, let's use it. Otherwise, we can just do it on our own.

grvsachdeva commented 5 years ago

If we want to implement this https://github.com/publiclab/mapknitter/issues/682#issuecomment-511258238, then we need to maintain version of warpable not nodes as hinted here.

Also, as warpable has all the essential attributes: Screenshot from 2019-07-15 23-22-05

We can have versioning of that. So, basic cases/implementation would be:

  1. Providing an option to mark a version in the Image toolbar via LDI -- So, it will create the nodes and mark image as a version.
  2. ImageSequencer case, - If we'll perform versioning on Warpable, then, we can even have new image in new version and so useful for Image Sequencer manipulations.