Forum Documentation Showcase Pricing Learn more

Time stamping a photo?


#1

Hi Bubblers.

I am looking to time stamp photos taken by users. The user will take a photo, but I need to be sure that the photo was taken at that specific time.

I do not want the user to be able to upload a photo that was taken previously (from their libary).

Any ideas on how to go about this?


#2

I think you need to extract the exif data. There’s a bunch of posts on the form that may help.

Here’s one: https://bubble.is/plugin/image-metadata-1523977766821x965646993422024700


#3

Thank you! Didn’t know anything about this…

I am half way there. Using @romanmg 's plug in I can pull the data, I am particularly interested in date and time. However, if I take a picture with my iPhone camera I do not receive the metadata.

I’ve noticed photos are .jpeg and screenshots are .png … is this the cause?

Any ideas?


#4

Yes, EXIF is specified for JPEG format. PNGs, while there are ways of embedding metadata in them, do not share that feature. So I guess if your app insists on “proving” the image’s “newness” you may have to reject PNGs.

This is in general a hard problem unless you’re developing for/on the native device and CAN control whether the you can force the user to use the device camera. (Not sure that this is even a thing… seems like something Apple would have in a native SDK though…)


#5

Hi Keith, appreciate your comments.

Just to be clear, .jpeg isn’t working for me, but .png are. I DO want photos taken by the iPhone camera to be used. I DONT want screenshots to be uploaded. Does this make sense?


#6

Hi @keith

In an ideal world Id have the camera “in-app” similar to snapchat. I want to be able to track where the photo originated and when it was taken. I’ve been told this isnt possible yet, so exploring work arounds.

It is essential that the user does not have the ability to upload any pictures that weren’t taken at that point in time.

If you can offer any insight I would appreciate being pointed in the right direction.


#7

To update on this a little further. Metadata is working for the JPEG files but only when they are uploaded from the Photo Library.

If you upload directly from the camera - there is no metadata. @romanmg Can you help?

Thanks.


#8

Are the below statements correct?

  1. If you take a photo with your phone’s camera and upload from the phone’s storage it works.
  2. If you take a photo with your phone’s camera and upload directly as you’re taking a picture it doesn’t work.

#9

Both correct, yes.


#10

I added numbers to the two statements above.

If you go path 2 and upload a picture to Bubble, are you able to process it after it’s in the Bubble database and see the exif data?


#11

Hmmm. This surprises me! It could be that there’s some issue with the metadata plug in…


#12

I have tried this:

  1. Take picture
  2. Upload to bubble database and create a new thing and go to a new page
  3. Display picture in a repeating group of those things
  4. Pull metadata from image on new page.

And this doesn’t work.

This was my attempt at processing the image into the bubble database and then pulling the metadata. Unsuccessfully.


#13

Not sure if this is relevant. https://forums.developer.apple.com/thread/96160


#14

This could be it, unfortunately I dont have these models to test.

If this is the issue, (I am using an iphone 7+) is it fixable form my side or would an update to the plugin be required? … Or is this a bubble issue?


#15

Well that SUCKS!


#16

Does it really matter if you know that the person is taking a photo immediately?

Is there a way to tell if the photo is coming from storage or the camera interface?


#17

It kinda seems like there’s not… though I do note that the HTML 5 media spec does let you tell a device if camera is the preferred image source.

The OP might want to look at this:

https://addpipe.com/html-media-capture-demo/

This is all a really interesting question and problem…


#18

Time stamping is the goal.

I want to know that the photo was taken when the user said it was taken. This is to protect against users uploading images from a previous event and pretending they are current.

I wanted the date and time to be overlaid over the camera screen but it seems this is also not possible.

image (similar to this)

If it was possible to restrict users to only being able to take a picture whilst in the app, not upload any files from folders this would be the ideal outcome.


#19

Right, so if you can limit uploads to only those taken from the mobile devices camera – which should be possible considering most apps have both a Camera option and Folder upload option.

So, I think you need to find out if that’s possible with Bubble’s uploader or some other way.


#20

Maybe @Reduble.com Multi-file uploader has a way to limit uploads only from the phone’s camera?

Otherwise you may need to build your own plugin. Here’s some ideas… https://stackoverflow.com/questions/41553976/opening-camera-from-android-webview/41570241#41570241

FineUploader is able to select from camera.
https://docs.fineuploader.com/branch/master/features/upload-from-mobile-camera.html