Discussion:
[KPhotoAlbum] GPS - get info from gpx, not from Exif
Benny Simonsen
2017-02-23 11:21:57 UTC
Permalink
Hi,

If I have understood the GPS mechanism correct, then the GPS location is
taken from the Exif data.
But I have also some gpx files that I would like to use for getting GPS
positions of my images *without* modifying my pictures.

I know that I can use e.g. gpsprune to embed the GPS data into the exif of
the images, but I don't like to modify my original images from camera.

What is the recommended way or how does other use the GPS support?
My approach is to embed the GPS into exif-info.db from a script - but are
there cases where the data in exif-info.db are flushed, except if I delete
it; regenerate it from KPhotoAlbum?

The script should be fully automatic based on:
- Camera ID(first part of filename)+timestamp in index.xml
- gpx-files (named depending on if it is mine, or another family member)
- A separate meta-data file:
- Correlates camera and qpx files (can change over time)
- Time offset in cameras

Anyone knowing of something that I should look into to get inspired / reuse
- It could e.g. be a good tool for injecting GPS data into images that I
modify to inject it into exif-info.db instead.

Br,
Benny
Tobias Leupold
2017-02-23 13:52:15 UTC
Permalink
Hi Benny!

There's no "official" way to bypass storing the GPS data in the EXIF
header. The EXIF DB is just a cache so that the data does not have to be
read from the images directly, so changes to the database will be
overwritten if some image's data is re-read.

Why don't you want to store the data in the EXIF header? This won't change
your image data, and there's a specific EXIF field for this very use case.
It's just like storing the correct roation of an image.

Getting the correct coordinates from a GPX track is not such an easy task
in some cases (according to my experience), thus I check the coordinates
and store them in the images to be sure they are correct.

At the moment, I don't see a reliable and persistant way to bypass the EXIF
mechanism and still use the map parts of KPA ...

Cheers, Tobias
Post by Benny Simonsen
Hi,
If I have understood the GPS mechanism correct, then the GPS
location is taken from the Exif data.
But I have also some gpx files that I would like to use for
getting GPS positions of my images *without* modifying my
pictures.
I know that I can use e.g. gpsprune to embed the GPS data into
the exif of the images, but I don't like to modify my original
images from camera.
What is the recommended way or how does other use the GPS support?
My approach is to embed the GPS into exif-info.db from a script
- but are there cases where the data in exif-info.db are
flushed, except if I delete it; regenerate it from KPhotoAlbum?
- Camera ID(first part of filename)+timestamp in index.xml
- gpx-files (named depending on if it is mine, or another family member)
- Correlates camera and qpx files (can change over time)
- Time offset in cameras
Anyone knowing of something that I should look into to get
inspired / reuse - It could e.g. be a good tool for injecting
GPS data into images that I modify to inject it into
exif-info.db instead.
Br,
Benny
Robert Krawitz
2017-02-23 14:07:06 UTC
Permalink
Post by Tobias Leupold
Hi Benny!
There's no "official" way to bypass storing the GPS data in the EXIF header. The EXIF DB is just a cache so that the data does not have to be read from the images directly, so changes to the database will be overwritten if some image's data is re-read.
Why don't you want to store the data in the EXIF header? This won't change your image data, and there's a specific EXIF field for this very use case. It's just like storing the correct roation of an image.
I don't care about location data myself, but one of the key points
about KPA (to me, at any rate) is that it doesn't insist on modifying
files to store metadata. Every time you modify a file, something can
go wrong.

Another reason would be if you're using signed image files -- some
cameras can sign the files in-camera, which some people need for
evidentiary reasons. I would expect both the image data and metadata
to be covered by the signature; if you modify the EXIF header, you'd
break the signature.
Post by Tobias Leupold
Getting the correct coordinates from a GPX track is not such an easy task in some cases (according to my experience), thus I check the coordinates and store them in the images to be sure they are correct.
At the moment, I don't see a reliable and persistant way to bypass the EXIF mechanism and still use the map parts of KPA ...
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Tobias Leupold
2017-02-23 19:07:58 UTC
Permalink
Post by Robert Krawitz
I don't care about location data myself, but one of the key points
about KPA (to me, at any rate) is that it doesn't insist on modifying
files to store metadata.
Well, it's not KPA that changes the file ...
Post by Robert Krawitz
Every time you modify a file, something can go wrong.
I personally never had a problem when I added GPS data to the EXIF headers of
my photos. Not one single image broke, same with adding the correct rotation
to the headers.

However, I think there's no reliable way to inject GPS data into KPA other
than adding it to the EXIF headers before.
Benny Simonsen
2017-02-25 20:20:45 UTC
Permalink
Tobias: Why don't you want to store the data in the EXIF header? This
won't change your image data, and there's a specific EXIF field for this
very use case. It's just like storing the correct roation of an image.

My primary reason for not modifying the original images are the first case
..., but one of the key points about KPA (to me, at any rate) is that it
doesn't insist
on modifying files to store metadata. Every time you modify a file,
something can
go wrong.
I think that thise is a fundamental thing in KPA

Other reasons:
- The checksum that are created when I import pictures to the computer will
break if I change them
- Backup - 2 versions of each image
- Most images I have in KPA are in RAW format

Why I use RAW images in KPA (Off topic, but might be interesting for
others):
- KPA handles RAW images well - I have various versions of Canon RAW and a
few Nikon RAW images
- 90% (or more) of my images are never processed manually
- When sharing images with others, I generate a html page with jpegs
- I have changed my flow from batch generating jpg's from RAW images, Prior
I generated jpg's as path of batch processing during import and used them
in KPA (don't remember why)
- Backsides by auto-converting images:
- Time consuming
- Space consuming

My newest RAW images are around 24MB
Getting the correct coordinates from a GPX track is not such an easy task
in some cases (according to my experience), thus I check the coordinates
and store them in the images to be sure they are correct.
I know that, and therefore I would like to store information in a metadata
file, and the final GPS data (with optional manual adjustments) should
propably be stored in a separate database and then injected into
exif-info.db or let KPA read the GPS data from a separte database.
Even though I normally prefer command line processing this might be a task
where a GUI would be good.

Just to clearify: Rotating images in KPhotoAlbum (e.g. by hitting 7 or 9)
does not change time exif data, it specifies the rotation index.xml.
Johannes Zarl-Zierl
2017-02-25 20:00:51 UTC
Permalink
Hi Benny,
Post by Benny Simonsen
If I have understood the GPS mechanism correct, then the GPS location is
taken from the Exif data.
This is correct.
Post by Benny Simonsen
But I have also some gpx files that I would like to use for getting GPS
positions of my images *without* modifying my pictures.
I know that I can use e.g. gpsprune to embed the GPS data into the exif of
the images, but I don't like to modify my original images from camera.
What is the recommended way or how does other use the GPS support?
As Tobias said: the recommended way to use GPS is by embedding the data into
the exif info. Which means altering the image file, unless we add support for
.xmp sidecar files.

Supporting sidecar files is on my long-term todo list, but until then you are
stuck with either modifying your files or using a unsupported, unofficial way.
Post by Benny Simonsen
My approach is to embed the GPS into exif-info.db from a script - but are
there cases where the data in exif-info.db are flushed, except if I delete
it; regenerate it from KPhotoAlbum?
Apart from caveat of being unsupported, this method should work. The exif
database is overwritten by the file's exif data on these occasions:

1. when adding a new image
2. when an image was moved
3. when an md5 sum change is detected
4. when the exif data is re-read explicitly (by the user)
5. when the gps fields in the exif db are not set
(just mentioning this for completeness - this does not affect your use-case)
6. when the whole exif db is recreated (by the user)

Since you already know not to press the "re-read exif data" button, and you
are obviously not modifying your own images, 1. and 2. are the important
points for you.

From 1. follows that you need to import the images first, then modify the exif
database.


HTH,
Johannes
Benny Simonsen
2017-02-25 20:24:32 UTC
Permalink
Thank you Johannes,

I think I can live with the cases where the database are overwritten, I
have it in under version control, and would probably also have the GPS data
in a separate file as well.

Br,
Benny
​

Loading...