Skip Navigation

[Resolved] Get EXIF location information

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#429540

I am trying to: Get EXIF data from a (user) uploaded image and use it in a location field (Toolset Views). Let me explain: a user has to upload a picture and a location. After uploading a picture I would like to use the location data (if any) of the picture as a default in the location input field (so the user doesn't have to type the location if we can get it from the image)

I visited this URL: (localhost)

#430031

With EXIF you mean metadata embedded within images?

That's not possible, I am not even sure WordPress can read that.

It seems though wp_get_attachment_metadata() can read it, and outputs it in the "['image_meta']['created_timestamp']" array value.
https://codex.wordpress.org/Function_Reference/wp_get_attachment_metadata

You can therefore create a ShortCode that does exactly this, it gets the above value from the Database AFTER it is uploaded with CRED.

Then you do a cred_save_data() action on this Form and update your Custom field with the TimeStamp it should provide.
https://toolset.com/documentation/user-guides/cred-api/#csd

You can use a Date Field of Types that accepts Timestamp out of the box.

#430184

I'm a bit further. I am now using the Exifography plugin to get EXIF data from uploaded images. It works. I can show the location data by adding [exif show="location"] to my view.

But.. I would like to show it directly after a user uploads a image (so in the CRED form). How can I upload the form with this new data so I could use the exif shortcode?

#430595

I do not think that ShortCode can get the data on the Fly.

So what you can do, is use that ShortCode to populate the field after - when the post is created.

But while Uploading, you need Custom JS/AJAX to check that value, as it's not yet even in teh Database as a stored meta.

What you can try is to hook into the CRED filter for the progress bar, you can use that filter to check the size of an image so theoretically it culd be possible to check other values too.
https://toolset.com/documentation/user-guides/cred-api/#cfauv

But how you will pass that Information on the fly to the Field in CRED, this requires Custom Code.

I do not see a "No-Code" Solution here.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.