Transferred images to computer, what now?

ios, latest app. collected a shitload of images, filled up the phone. transferred some (5+ k) images to the computer, deleted them from the phone. tried to upload… no mapillary tags.
a quick check with jhead, no gps info.

did i just lose half a day of images ? i don’t want to think about that possibility right now because it would piss me off too much :confused:

Since the new camera implementation, meta data is not added during capture anymore, and is instead added when the photos are uploaded. If you want to “export” them via iTunes etc, then you need to process them first. You can do this in the Uploads view using the top left button:

The reasons for postponing adding the meta data are
a) it saves battery (since it’s a quite resource demanding job)
b) it increases stability (since it’s a quite resource demanding job)
c) it enables twice as fast capture rate (since it’s a quite resource demanding job)

Your photos may be safe. It depends on if you deleted the meta files from the app or not. If you didn’t, you can move back the photos to the app and let it add the meta data, and then move the files to your computer again.

Since the meta data is stored in readable json-files, it would also be possible to copy the meta files to your computer and let a script do the work there instead. We don’t have a script ready yet, but I can ask some of our script wizards to create one.

2 Likes

Yubin is working on a script now.

huge thanks for the detailed reply.
it would be interesting to find out whether it is possible to add metadata without rewriting/recompressing the whole image - but that’s a bit longer-term topic.

i haven’t deleted any files manually besides the image directories. the metadata files, where are those stored and how can they be retrieved ?

It’s on my todo to check if we can manipulate the exif without rewriting the image. First stop is to investigate libexif if that’s suitable for iOS.

To transfer the meta data you need to use iTunes. All meta data resides in the directory called cameras in the documents folder of the app. Inside there will be one directory for each camera: internal, gopro-something, garmin-something etc.

If you need further instructions for iTunes, I’ll happily give you those as well.

thanks again - i have transferred the ‘cameras’ directory (looks like i can’t dive into subdirs in itunes to only transfer some files ?)

looks like ‘cameras/internal’ jas a single json file for each image (all placed in the same directory).
naming seems to be matching file.jpg to file.json.
if that is correct, it looks like in one example sequence i checked the first 9 images have their json files missing. two other sequences i checked do not seem to have any missing jsons at the very beginning.

what’s the logic used to remove camera/gps json files ? how could some of them be missing for images that weren’t uploaded from the phone app ?

In iTunes you can’t navigate much, but in this case it’s fine as the cameras directory is pretty small anyway.

We have a check if GPS has changed or not, and if it hasn’t since last file write, we don’t write a new file. There is no reason to write 20 json-files if the position is the same according to the GPS. So if a json-file is missing, it finds the before and after json-files instead, and then interpolates the position using the time.

When data is written to an image (at upload or using the processbutton), the meta file is removed too.

It’s however weird that some files are missing in the beginning! Especially if you haven’t uploaded any from that sequence. Need to think about this for a while.

if the gps position was the same and json file was not written, why do interpolation ? wouldn’t the location be the same as for the previous image ?

as for the missing jsons, i’m not sure whether any images from the sequence have been uploaded - they might be.

when uploading, when exactly is the data added (and json removed) ? is it done per sequence, or for individual images right before the uploading that image ?
if the latter, couldn’t that result in missing json files in some cases ?

Well, it’s not uncommon for the GPS to report the same position even though you move (by walking or driving etc).

The merging is done file by file, just before it’s uploaded.

Ah you might have found the bug right there. Imagine there is a gap of json-files (say 10). You upload a file and the json-file is removed. Then the next 10 will be missing files. So I think it’s best to enable writing the json file anyway even if GPS hasn’t changed.

ah, so the interpolation is to deal with potential incorrect coords, got it.

yeah, the case of ‘upload one image, nuke the json and then have no data for the next few’ was the case i suspected :slight_smile:
maybe it can be changed to remove json files for previous uploads when a new json file is found ? that will allow you to avoid writing those files and avoid the dataloss at the same time. (although there could be extra cases when upload is stopped, app is forcefully closed etc…)

but what did the app do in cases like this ? let’s say a json file is removed, we move to the next file, we don’t have the previous json anymore. what happens ?

also, is this logic the same in the android & ios apps ?

I’ll change so that for every image is saves using the internal camera, there will be a matching json file. I haven’t checked how many writes we save, but it’s probably not that many overall, so might as well save all.

If the “before json file” is missing, we use the two json files after, and then calculate the direction and interpolate using time. This is mostly needed for external cameras, but helped in your case as well this time.

For external cameras we cannot match a json file with an image, instead we use time, and therefore we never delete json files for external cameras. The user can do it manually in Settings though.

This is for iOS only right now. We try different things on iOS first and then all the good stuff trickles down to Android eventually. Development is a bit behind on Android so that’s why we do the experiments on iOS first, and in the mean time Android catches up. Eventually Android and iOS will be more or less the same.

thanks again. got curious - when interpolating, do you use the “MAPAccelerometerVector” information in any way, or is it purely based on 2 images (either before/after, or both after) and time ?

the json files also contain TrueHeading and MagneticHeading - i assume you simply use TrueHeading, right ?

I only use time to do the interpolation.

I don’t think we use MAPAccelerometerVector for anything right now, but perhaps in the future, like detecting blurry images because the phone was shaking during capture. It only shows acceleration, so if you travel at a constant 90 km/h, the acceleration vector mostly points down (i.e. gravity) + some shaking.

Yup I think we only use TrueHeading, not really sure why we store MagneticHeading, probably just something legacy.

ok, still a few more questions :slight_smile:

  • i guess that data is added to the images right before uploading that image, not per sequence, right ? that probably slows down the upload a bit on a really fast connection, but doesn’t matter that much in most cases.
  • when moving images from the phone to a computer, quite often i want to do that really quickly to free up some space on the phone. if i’d like to add metadata to the images, i can only do that for all images, which is very unfeasible for, let’s say, 50k images :slight_smile:
    is it possible to add a way to tag only single sequence ? should i create an issue in the github project ?
  • saving json for all images, is that already in the latest version of the app, or is that still to come ? should i create an issue in the github project ?
  • the last number in the filenames & json tags, is that milliseconds ?
  • having a single json file per image slows down working with them on a computer a lot. would there be any improvement in writing a json per sequence instead ?
  • i guess that data is added to the images right before uploading that image, not per sequence, right ? that probably slows down the upload a bit on a really fast connection, but doesn’t matter that much in most cases.

Correct. One way I could improve it is to process the images in the background while already processed ones are being uploaded

  • when moving images from the phone to a computer, quite often i want to do that really quickly to free up some space on the phone. if i’d like to add metadata to the images, i can only do that for all images, which is very unfeasible for, let’s say, 50k images smile

That’s correct. The best way to solve this is to make the meta merging really fast. I have high hopes to be able to do this. In that case they could be processed as soon as the uploads view is displayed.

  • is it possible to add a way to tag only single sequence ? should i create an issue in the github project ?
    saving json for all images, is that already in the latest version of the app, or is that still to come ? should i create an issue in the github project ?

Right now you can only do it for all sequences/images by pressing the top left button in the Uploads screen. Main reason is the question of where to place the button. You can create an issue on Github if you want this feature added.

  • the last number in the filenames & json tags, is that milliseconds ?

Yup.

  • having a single json file per image slows down working with them on a computer a lot. would there be any improvement in writing a json per sequence instead ?

It might be faster to use one file. A downside is stability concerns and corrupting the file in case something goes wrong for whatever reason. In the future we will make a single proper GPX file from the jsons which can be used with any popular GIS app, so the jsons aren’t really meant to be exposed to the end user. The GPX file will also be uploaded to the backend and integrated into the Uploader, so if you transfer images to the computer you don’t need to worry about transferring the meta data in the future – it should be available for the Uploader directly from the backend.

Hmm, I might be in a mess, but not sure what I can do about it.

Long story short, I have 25K+ pictures taken handheld during the last two weeks on the island of Hiddensee, really nice sequences that costed me lot of effort.

All of the images was tranferred to my laptop the old way, i.e. I dropped the folders from the iPhone down to the laptop. I’m used to just upload the folders back to the iPhone and then letting the app upload them, but not anymore.

When I try to upload let’s say 4000 pictures, the upload winds through then in less than a minute and says: “Nice Work” and they are gone from the phone. Really, really frustrating…

If you think you can help me, you might need to know:

  1. I took pictures and saved the folders
  2. The Mapillary app was updated to a new version
  3. I took even more pictures and saved the folders
  4. I restored by phone back to factory defaults (to make room for longer sequences)
    4a) The camera and viewer folder has been destroyed in this proces…
  5. I took even more pictures and saved the folders
    5a) First time a saved a folder that contained “_thumb” images, I deleted the thumb images because i thought in was the PC OS that had made them.

What do you think can be saved? Anything?

I would really hate to just drag 25K pictures to the recycle bin :frowning:

/Victor

i’m just guessing here based on the information provided by Anders in this thread.
if you cleared your phone so badly that the “cameras” directory was lost, i don’t think you can recreate any of the location data. did you happen to have a separate gps device that recorded a trace (for osm), maybe ?

i guess our cases show the dangers of changing where/how the data is stored - users uploaded images simply by copying them out of the phone previously, and they just followed the same process as before - but ended up [potentially] losing the location data…

but i have another question, too :slight_smile:
Anders, are there cases when the app would actually delete an image without uploading it ? that would be pretty bad and could easily mask bugs.

@VicVal, sorry to hear about your troubles.

  1. Most likely deleted the meta files with sequence information etc. Unless you backed up the “cameras” directory, the meta data is gone.

Since the images still have have GPS information in them, you can try uploading them using the web upload or using scripts if you prefer that. You cannot upload them using the app without the meta information though.

I think it would be a good idea to allow upload via the app even if you delete the meta information. Let me think about this for a while.

@Richlv I really think we need to add add the release notes so they are popped up when app is upgraded and started for the first time, at least for major changes.

Photos are only deleted when
a) a photo is uploaded successfully
b) a matching meta data file for a photo taken using the iPhone camera cannot be found (which was @VicVal’s case above). It should never happen otherwise.

right, but you have to remember that many users just hit on buttons until popups go away, and they might not read it…

and, unless tag writing can be made very fast, how about this - if the app is in the shooting mode and is stopped, or has paused in the driving mode, write tags in the background ?
we still need tags on all images, and the sooner we start writing them, the better…

the only reason not to do so that i can think of - battery life. one might want to save battery during the capture (if the phone is not connected to power), while it is more likely to be connected to power during the upload.