• Resolved meggsico

    (@meggsico)


    Hi Joe

    I have opened a new topic as you wished.

    For other users my issues are placed here.

    When i upload a image with gps coordinates, the image is set in the middle of the map. The coordinates are not taken into account.

    Joe you are right. If i take the image from the media library the image is not not placed correct on the map. If i upload it through the WordPress media uploader in waymark than it works. Sorry that i described my issue wrong.

    Can you fix this issue?

    I can’t upload gpx-Files. Nothing happens if i want to do this. In the console of firefox i get always this message.

    I had added the following line in my wp-config.php before i used waymark.

    define( 'ALLOW_UNFILTERED_UPLOADS', true );

    But i checked the log in the console of firefox with your new version b3 and I get still a error message like

    The file type uploaded is not supported.

    This is strange because I can upload a *.gpx file through the WP upload manager and i added the code line above.

    Thx for your response

    Meggs

    • This topic was modified 4 years, 8 months ago by meggsico.
    • This topic was modified 4 years, 8 months ago by meggsico.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Joe

    (@morehawes)

    Hi @meggsico,

    Thanks for starting a new topic for this.

    Can you fix this issue?

    If the issue is as I understand it then the problem is that the location information is being removed before it is uploaded to Waymark. Because of this there is no way for Waymark to get this information, it must be included in the file.

    This is strange because I can upload a *.gpx file through the WP upload manager and i added the code line above.

    This bug is very difficult to get to the bottom of, but if you are willing to help then it would be very useful to try a few things ??

    First off, could you please install this version of the plugin and try to upload a GPX file. This version should output some extra information in the console once you have uploaded the file. Please can you provide me with the console output?

    Also if possible could you provide a link to a sample GPX file that you are unable to upload?

    As always, I suggest backing up your install before activating beta releases, especially on production sites!

    Many thanks!

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hello Joe

    If the issue is as I understand it then the problem is that the location information is being removed before it is uploaded to Waymark. Because of this there is no way for Waymark to get this information, it must be included in the file.

    I downloaded some images with a ftp-client from my Web-server. In all images the location data are still available.
    Do you think that the transfer from the library to waymark deletes the location data?
    Does it help to change the WP media uploader? What do you think?

    First off, could you please install this version of the plugin and try to upload a GPX file. This version should output some extra information in the console once you have uploaded the file. Please can you provide me with the console output?

    Joe, did you change anything? It works with Vb3 :-). Thank you very much for your great support. Yessss man!!!!. I’m so happy.

    I would be happy if you could provide two new features.

    – If you select fullscreen on the map. I would be great if you can show the loupe for searching other places on the map. Maybe you can add a additonal tag for a shortcode.

    – It would also be great if i can insert the elevation graph in fullscreen mode. Maybe the graph could be displayed as overlay on the map.

    Many thanks!

    Meggs

    • This reply was modified 4 years, 8 months ago by meggsico.
    • This reply was modified 4 years, 8 months ago by meggsico.
    • This reply was modified 4 years, 8 months ago by meggsico.
    Plugin Author Joe

    (@morehawes)

    Joe, did you change anything? It works with Vb3 :-). Thank you very much for your great support. Yessss man!!!!. I’m so happy.

    Great news! ?? I changed a few things in that version so I am still not 100% sure on the fix, please can you confirm that this is working for you in the latest development release (0.9.14-b4)?

    If you select fullscreen on the map. I would be great if you can show the loupe for searching other places on the map. Maybe you can add a additonal tag for a shortcode.

    Good idea, I will add this to the “to-do” list.

    It would also be great if i can insert the elevation graph in fullscreen mode. Maybe the graph could be displayed as overlay on the map.

    Yes I see that this is not ideal. I will look in to how complicated this would be.

    I downloaded some images with a ftp-client from my Web-server. In all images the location data are still available.
    Do you think that the transfer from the library to waymark deletes the location data?
    Does it help to change the WP media uploader? What do you think?

    Is the problem only with existing photos in the WordPress Media Library? By default, WordPress does not store location metadata when you upload a photo, this capability is added by Waymark. Because of this, Waymark can not read the location metadata of photos uploaded to the Media Library while Waymark was not active. So even if location metadata is contained in the original file, Waymark can not access it.

    I hope that makes sense. If you are still having difficulties while uploading photos with Waymark active, please provide a link to the original image and describe the exact steps you are taking.

    I really appreciate your help in tracking down these bugs, they can be very difficult to fix if I am not able to replicate myself.

    Cheers,

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hi Joe

    Great news! ?? I changed a few things in that version so I am still not 100% sure on the fix, please can you confirm that this is working for you in the latest development release (0.9.14-b4)?

    Version b4 works for me.

    Is the problem only with existing photos in the WordPress Media Library? By default, WordPress does not store location metadata when you upload a photo, this capability is added by Waymark. Because of this, Waymark can not read the location metadata of photos uploaded to the Media Library while Waymark was not active. So even if location metadata is contained in the original file, Waymark can not access it.

    I explain the issue in more detail. All my images has the location tag. Because i take fotos with my phone or i set the location tags in my images. So if i upload images (without Waymark) to the WP library all this image has still the location tag. I checked this, i downloaded the uploaded images ?? from the web-server and checked the metatags of the images. So the WP library stores the location tag.

    If i put images from the library through Waymark, the location tags are not used. If i uploaded images from my hard-disk through Waymark, the location tags are used and the images are on the right place on the map. So I’m convinced it is possible to solve this problem :-).

    Joe, one more feature.
    Is it possible that i use the gpx-files from the media-library. This would be great because i store all gpx-files on my web-server. Now in waymark I can only use gps files from my harddisk.

    Oh, and by the way, of course i will help you to find all bugs in your great plugin :-).

    Cheers,
    Meegs

    • This reply was modified 4 years, 8 months ago by meggsico.
    Thread Starter meggsico

    (@meggsico)

    Joe, now i realized the problem. WP don’t store the location tag in the database. But of course the image itself still has the coordinates.

    I was looking for a plugin. I think the free-plugin Media Library Assistent can extend the fields of the WP Media Library.
    Custom Fields

    • This reply was modified 4 years, 8 months ago by meggsico.
    Thread Starter meggsico

    (@meggsico)

    Joe, it works. Can you use my fields for input in waymark?
    screenshot (The link is available only for 12h)
    Because I have many photos on the server. I don’t want to upload them all again via waymark. And with the plugin mla i can update the images in bulk.

    thx,
    Meggs

    • This reply was modified 4 years, 8 months ago by meggsico.
    • This reply was modified 4 years, 8 months ago by meggsico.
    Plugin Author Joe

    (@morehawes)

    @meggsico,

    Version b4 works for me.

    Great news! This bug has been bothering me for some time.

    Oh, and by the way, of course i will help you to find all bugs in your great plugin :-).

    I really appreciate your help!

    Is it possible that i use the gpx-files from the media-library

    Good idea, I will give this some thought.

    Joe, now i realized the problem. WP don’t store the location tag in the database. But of course the image itself still has the coordinates.

    Yes that’s right.

    Because I have many photos on the server. I don’t want to upload them all again via waymark. And with the plugin mla i can update the images in bulk.

    An interesting idea. In theory this is possible, but the EXIF location data must be converted to numerical latitude/longitude values to be used by Waymark. For Waymark to access them, they need to be stored as GPSLatitudeNum and GPSLongitudeNum.

    For example:

    GPSLatitudeRef	North
    GPSLatitude	50° 23' 16.71"
    GPSLongitudeRef	West
    GPSLongitude	127° 15' 52.602"

    Becomes:

    GPSLatitudeNum	50.387975
    GPSLongitudeNum	-127.264611

    Waymark has a helper function available that does this, which was adapted from this. The code looks like this:

    $meta['GPSLatitudeNum'] = Waymark_Helper::exif_gps_to_gps_float($exif_data['GPSLatitude'], $exif_data['GPSLatitudeRef']);
    
    $meta['GPSLongitudeNum'] = Waymark_Helper::exif_gps_to_gps_float($exif_data['GPSLongitude'], $exif_data['GPSLongitudeRef']);

    So you should be able to use this, but it will require some coding. Apologies that this is a rather technical answer. There may be an easier way to do it, but that’s as far as I am able to help you at this time.

    Please let me know if you make any progress and thanks again for all of your help!

    Joe

    Thread Starter meggsico

    (@meggsico)

    (@morehawes),

    An interesting idea. In theory this is possible, but the EXIF location data must be converted to numerical latitude/longitude values to be used by Waymark. For Waymark to access them, they need to be stored as GPSLatitudeNum and GPSLongitudeNum.

    The numerical latitude/longitude values are stored for each image. I also used the name of the fields “GPSLatitudeNum” and “GPSLongitudeNum” in the plugin mla. But it doesn’t work. The images are still placed in the middle of the map.

    According mla the “Attachment Metadata” are stored in the “_wp_attachment_metadata” custom field.

    Screenshot

    Joe, do you have an idea what we can try?

    Thx
    Meggs

    Plugin Author Joe

    (@morehawes)

    Hi @meggsico,

    According mla the “Attachment Metadata” are stored in the “_wp_attachment_metadata” custom field.

    That’s right. Here is an example taken from my database, you may want to check your values are being stored in the same way:

    a:5:{s:5:"width";i:3264;s:6:"height";i:2448;s:4:"file";s:16:"2019/10/nl-6.jpg";s:5:"sizes";a:5:{s:9:"thumbnail";a:4:{s:4:"file";s:16:"nl-6-450x450.jpg";s:5:"width";i:450;s:6:"height";i:450;s:9:"mime-type";s:10:"image/jpeg";}s:6:"medium";a:4:{s:4:"file";s:16:"nl-6-300x225.jpg";s:5:"width";i:300;s:6:"height";i:225;s:9:"mime-type";s:10:"image/jpeg";}s:12:"medium_large";a:4:{s:4:"file";s:16:"nl-6-768x576.jpg";s:5:"width";i:768;s:6:"height";i:576;s:9:"mime-type";s:10:"image/jpeg";}s:5:"large";a:4:{s:4:"file";s:17:"nl-6-1024x768.jpg";s:5:"width";i:1024;s:6:"height";i:768;s:9:"mime-type";s:10:"image/jpeg";}s:14:"post-thumbnail";a:4:{s:4:"file";s:16:"nl-6-825x510.jpg";s:5:"width";i:825;s:6:"height";i:510;s:9:"mime-type";s:10:"image/jpeg";}}s:10:"image_meta";a:18:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";s:11:"orientation";i:1;s:8:"keywords";a:0:{}s:11:"GPSLatitude";a:3:{i:0;s:4:"45/1";i:1;s:4:"28/1";i:2;s:8:"5828/100";}s:14:"GPSLatitudeRef";s:1:"N";s:14:"GPSLatitudeNum";d:45.48285555555556;s:12:"GPSLongitude";a:3:{i:0;s:4:"62/1";i:1;s:4:"38/1";i:2;s:8:"2414/100";}s:15:"GPSLongitudeRef";s:1:"W";s:15:"GPSLongitudeNum";d:-62.640038888888888;}}

    Joe, do you have an idea what we can try?

    Waymark receives all of this metadata when adding an image from the Media Library and checks for the presence of GPSLatitudeNum and GPSLongitudeNum numerical values. If it finds them it should place the Marker at these coordinates.

    Are you seeing anything output in the console when you add an image from the Media Library through the Waymark Editor?

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hi @morehawes

    The values are not stored in the same way. I see only the coordinates in the field GPSLatitudeNum and GPSLongitudeNum. They are not stored under _wp_attachment_metadata.

    The error: Waymark Info: Image location metadata (EXIF) not detected.

    Meggs

    Plugin Author Joe

    (@morehawes)

    Hi @meggsico,

    That would explain it then, the GPSLatitudeNum and GPSLongitudeNum values need to be stored in the database along with the other _wp_attachment_metadata data for Waymark to be able to access them.

    This is outside of the scope of what Waymark does right now, but I will keep this in mind for the future.

    Cheers,

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hi @morehawes,

    This is outside of the scope of what Waymark does right now, but I will keep this in mind for the future.

    This sounds good. I hope you will do this soon :-).

    The plugin mla can also categorize images. So It is possible that user can see images in according to their user role respectively to their image category. This would be also a good feature for your plugin. You can add a lot of pictures to the map, but user can see only their category.

    Cheers,

    Meggs

    Thread Starter meggsico

    (@meggsico)

    Hi @morehawes,

    It works. I can add in bulk the gps-coordinates in the images of the WP Media Library with the plugin Media Library Assistent which are not uploaded by waymark.

    For other users I wrote the following how-to. It is similar to the post. But this is adapted to the Plugin “Waymark”.

    1. Navigate to the Settings/Media Library Assistant “Custom Fields” tab.
    2. Make sure the “Enable custom field mapping when adding new media” box is checked. If not, check the box and click “Save Changes”.
    3. Scroll down to the “Add New Custom Field Rule” area below the “Enable” checkboxes.
    4. Under the “Name” dropdown control, click “Enter new field” to create a new custom field.
    5. In the “Name” text box, give the field the name “meta:image_meta.GPSLatitudeNum”.
    6. From the Data Source dropdown list, select “- Template (see below) -”.
    7. In the “Meta/Template” text box, enter [+exif:GPS.LatitudeSDD+].
    8. Click the “MLA Column” check box if you want to make the field available in the Media/Assistant submenu table. You can also click the “Quick Edit” and “Bulk Edit” check boxes to make the field available in the Media/Assistant submenu table Quick Edit and Bulk Edit areas if that’s useful for you.
    9. In the “Existing Text” dropdown list, select “Replace”.
    10. In the “Format” dropdown list, select “Native”.
    11. In the “Option:” dropdown list, select “Text”.
    12. Click the “Delete NULL Values” checkbox.
    13. Leave the “Status” set to “Active” so the rule will be executed for future additions to the Media Library.
    14. Click the “Add Rule” button to save your work.

    Do the same for the Longitude Coordinates. But use the name “meta:image_meta.GPSLongitudeNum” and in the “Meta/Template” text box, enter [+exif:GPS.LongitudeSDD+].

    Once the rule is created you must execute it to create the “Latitude” and “Longitude” values for the items already in your Media Library:

    1. Find the “meta:image_meta.GPSLatitudeNum” and the “meta:image_meta.GPSLongitudeNum” in the table of rules o the right-hand side of the screen. If you don’t see your new rule, type the name you gave it in the search box above the table and click “Search Rules”.
    2. Click the “Execute” action in the bulk menu.
    3. Wait for the mapping process to complete.

    Thanks again for the great plugin waymark.

    Meggs

    • This reply was modified 4 years, 8 months ago by meggsico.
    • This reply was modified 4 years, 8 months ago by Yui.
    Plugin Author Joe

    (@morehawes)

    @meggsico,

    Very glad to hear you got this working and thank you for posting this walk-through, I am sure others will find it useful ??

    I did have a quick play with adding such a feature to Waymark, but I ran into some complications. I will bear this in mind for the future, because I definitely see the benefits of this.

    I have just released v0.9.14 of the plugin, thanks again for all of your help.

    Cheers,

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hi Joe

    I did have a quick play with adding such a feature to Waymark, but I ran into some complications. I will bear this in mind for the future, because I definitely see the benefits of this.

    This sounds cool. Please make it possible to use also the categories and tags from the plugin “Media Library Assistent”. Because all my tousend of fotos are taged with mla ??

    Cheers,

    Meggs

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Some issues’ is closed to new replies.