OpenOversight icon indicating copy to clipboard operation
OpenOversight copied to clipboard

Officer identification: Enable rotation of photos

Open redshiftzero opened this issue 7 years ago • 4 comments

Some photos are not upright. We should be able to zoom or rotate them in the officer identification page.

redshiftzero avatar Feb 17 '18 06:02 redshiftzero

So I looked into this and it turns out that the javascript we use (cropper.js) already supports rotating, so from front-end we only need to change the template a little bit (adding a button the user has to click basically).

I took a quick lock what happens on the back-end, but not familiar with it yet. But basically we have two options I think: First one is to replace the original image by a correctly rotated version. This would also mean dealing with previously created images which should probably rotated accordingly. (Assumption being that people selected the face correctly, it just needs to be rotated). This also has the advantage that the user only has to rotate the image once. Disadvantage could be that we allow people to change already created pictures, so that would maybe give people who want to create chaos a chance, not sure about that

The other option would be to add the degree of rotation as another field to the Face-model and not change the original picture but rotate each 'derived' picture. This would probably be easier to implement, but might annoy users, as the rotation might not be saved while adding several tags on one picture.

I am interested in trying to work on this, any comments appreciated

abandoned-prototype avatar Feb 05 '19 04:02 abandoned-prototype

There is an old branch https://github.com/lucyparsons/OpenOversight/tree/370-rotate-photos and it seems the goal was to fix this issue. Not sure if the author @raq929 is still around, but I am curious what happened with it/why this wasn't merged back then.

abandoned-prototype avatar Feb 11 '19 20:02 abandoned-prototype

Hi! I'm still kind of around! I moved to western MA and my internet is terrible such that working with photos is really hard. But, as far as I know this branch was in pretty good shape - probably needs some styles. Feel free to take it over and rebase it on master and see how it goes.

It looks like I decided on the latter of your two options, although honestly I can't remember why. My memory is that I might have decided on both options? But I'm not seeing that in the code. I'm happy to answer questions if they come up!

raq929 avatar Feb 12 '19 21:02 raq929

Thanks for your reply! I am happy to take over and will let you know if I have any questions.

abandoned-prototype avatar Feb 12 '19 22:02 abandoned-prototype