-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate EXIF functionality (and some refactors) #169
Conversation
Cool! We can do altitude in follow-up, it's pretty imprecise but we have
some prior info on this here and some ideas for refining it too.
publiclab/mapknitter#159
publiclab/mapknitter#176
publiclab/mapknitter#67
In one of those I think we have a sample image with altitude data to work
from.
Thanks, I'll review tomorrow! Much appreciated!!!!
…On Sun, Mar 17, 2019, 5:42 PM Pranshu Srivastava ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/edit/tools/getEXIFdata.js
<#169 (comment)>
:
> @@ -0,0 +1,85 @@
+L.EXIF = function getEXIFdata(img) {
move the image to that location on the planet
resize it, rotate it using the available data, as in the below code
pan the map to the new position so the user can see it
@jywarren <https://github.com/jywarren> I've implemented all of the above
except the resizing (scaling/distort) one since there is no available data
for that in the EXIF tags. What do you think? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#169 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ4EpA43Bbi5SUUQNbhabKartyfGjks5vXra-gaJpZM4b0u3d>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this looks good to go, once we remove the alert()
. We could also add a confirm()
instead of alert()
so that people are prompted "Geolocate this image and move it to the location found?" with Ok and Cancel options. But we don't have to; we could just move it immediately.
Thanks a lot for this one, it's going to be great!
Pinging @jywarren. |
Just mentioning here that his PR was referenced on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rexagod @jywarren Reviewing this now!
This is really cool. A few things to address:
- For some reason it isn't working with
select.html
, but I guess the 1st step would be to rebase this and then look into that. If it's complicated to fix I think that would be ok to address in a new PR if preferred. - It is still printing to the console. @jywarren @rexagod did we still want to add a returned value instead? I think that would be good to fix here, and removing all the
console.log
s because I have noticed those upstreamed in mapknitter already! - Minor separate suggestions below (sorry I know you probably were planning on refactoring this after @jywarren confirmed implementation but just in case)
- potentially move dependency restructuring to new PR?
And last thing: is this still meant to be addressing the refactoring of the src/edit/DistortableImage.EditToolbar.js
file? Is the idea now to move all of the toolbar tool action code being executed into separate files in /tools
? So for example, all the toggle___
methods?
Co-Authored-By: Sasha Boginsky <[email protected]>
@sashadev-sky I'm seeing asynchronous bugs for the PS. To summarize, this branch has been rebased and @sashadev-sky's suggestions have been implemented, and everything looks good except the |
Update: Just verified. The package (exif-js) is still at the same version In this PR and the main branch, so that shouldn't be the source of this bug. Can't figure out what exactly is causing this? |
It'd be nice but we have too many inter-dependent PRs so let's try to solve things one at a time. That may mean #225 can be merged if we don't need to solve these all at once. @rexagod can you elaborate on the exact timing issue? If we need to pin the exif-js ref to a specific commit from when it was working before, we can do that for now to unblock this. Like, whatever commit from back in time. But it was last published 2 years ago so seems unlikely? https://www.npmjs.com/package/exif-js |
Hey all, i wondered if you're ever needing cross-reviews or troubleshooting maybe it would be good to connect @Rishabh570 with you all here (see recent work here: publiclab/community-toolbox#236). You're all doing complex JS architecture so i wanted to make the connection in case it's helpful, for example with the timing bug here! 🙌 |
I would love to contribute to this in any way possible for me, seems like there's some unresolved bit here which has put this to halt.
So |
@@ -13,11 +13,14 @@ | |||
|
|||
<!-- for full-res export --> | |||
<script src="../node_modules/jquery/dist/jquery.js"></script> | |||
<script defer src="../node_modules/webgl-distort/dist/webgl-distort.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rexagod Do you feel its better not to have the defer
? I put it there to speed up initial page load
@@ -160,6 +161,7 @@ module.exports = function(grunt) { | |||
'concat:dist' | |||
]); | |||
|
|||
// disable for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rexagod why did you want this one disabled? is this still the case?
var image = this._overlay.getElement(); | ||
addHooks: function () { | ||
var overlay = this._overlay; | ||
var image = overlay._image; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var image = overlay._image; | |
var image = overlay.getElement(); |
L.tools = L.tools || {}; | ||
|
||
L.tools.EXIF = function getEXIFdata(ref, overlay) { | ||
var GPS = ref.exifdata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would want to update this part to use 3 vars as per new code standardization rules
typeof GPS.GPSLatitude !== "undefined" && | ||
typeof GPS.GPSLongitude !== "undefined" | ||
) { | ||
// sadly, encoded in [degrees,minutes,seconds] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you didn't copy over this code comment I just wanted to confirm if its irrelavent now or could still be useful
|
||
var panTo = L.latLng(lat, lng); | ||
|
||
var x_diff = overlay.getCorner(0).lng - overlay.getCorner(1).lng; // width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets update this and below to deltaX and deltaY to abide to JS camelcase convention?
@rexagod I have a different implementation in mind to make exif work, I opened the PR in #421 . Basically So I was thinking we could close this PR and work from #421 instead. What do you think? |
Follow-up on #156. Based off #161. Refer this.