-
Notifications
You must be signed in to change notification settings - Fork 58
sync
If you have images on your pc and on your android device you need some mechanism to keep images and their meta data (geo-latitude/longitude, tags, filepath/names) in sync.
This page describes technical details how this could be done
See also:
- edit metadata
- find photos
- define Virtual ALbums
- autoprocessing
- [supported meta data (exif,xmp,iptc)](supported meta data (exif,xmp,iptc))
- pc android meta sync
- Example: Take photos on android, autoprocessing (rename and add exif while move), transfer to pc
- Technical background: Imagefiles, Android-Mediadatabase and meta data
- Copy from pc to android
- Copy from android to pc
- PC software : IrfanView, ExifTool, apmXxxx.cmd, apmXxxx.args
On android images are files with the extension ".jpg" that are usually stored somewhere below the folders DCIM or PICTURES. The Mediascanner is an android service that automatically scans the file system for media files (image, audio, video) and store the scan results in the android MediaDatabase. Android-Gallery apps use the MediaDatabase to find videos and images.
The android stock mediascanner reads data from
- the jpg exif segment that contains CreateDate (when photo was taken) and geo location (latitude/longitude)
- and data from the filesystem (filename with full path, date when the file was last modified)
Since "A Poto Manager" uses the android stock MediaDatabase it can find/sort by path/photo-date/geo without any extra media scan. All work was already done by android stock media scanner.
jpg files can have additional meta data in the jpg iptc segment which is not supported by android but by "A Poto Manager": tags(keywords), Image-Title, Image-Description, Image-Rating.
Because memory and display is limited on the android device i usually create a scaled down copy of the images on the pc to 1024 x xxx or xxx x 1024 using irfanview batch processing which can be downloaded here. The reduced images contain all meta data.
If you do not need to transfer the iptc-meta-data (tags(keywords), Image-Title, Image-Description, Image-Rating) to android you are done.
(since version 0.6.1) : Else you have to invoke the "a Photo Manager" build-in media scanner that can also read tags(keywords), Image-Title, Image-Description, Image-Rating form jpg-iptc and/or jpg-exif.
(b) Create xmp files
Currently there is no library to read/write iptc-meta-data inside jpg files for android so i "A Poto Manager" can use external sidecar files to store the extended metadata in xmp file format instead. You can use the apmJpg2xmp.cmd batch to generate one xmp file per jpg file and copy these to android. You need to run "A Poto Manager"-s mediascanner to scan all jpg/xmp files which might take a long time if you need to (re)scan many files. See apmXxxx.cmd below.
(c) Create csv file
You can add all extended metadata into one csv file that "A Poto Manager" can read. This processing is much faster than rescan. The "apm2Csv.cmd" batch can generate this csv file on a pc.
-
Execute apm2Csv.cmd in the pc images rootfolder.
- Example: execute
apm2Csv.cmd
in folder C:\Users\MyUserName\Pictures\managedPhotos`
- Example: execute
-
Copy the generated file media.csv into the android image rootfolder
- Example: copy pc file
C:\Users\MyUserName\Pictures\managedPhotos\media.csv
to android/sdcard/PICTURES/managedPhotos/media.csv
- Example: copy pc file
-
On Android open a filemanager and click on the copied media.csv
- Example: click on
/sdcard/PICTURES/managedPhotos/media.csv
See apmXxxx.cmd below.
- Example: click on
With "A Photo Manager" you can set (geo-latitude/longitude, edit tags or change filenames of images (copy/move/rename/delete). This chapter explains how you can get the changes back to the pc.
Since "A Photo Manager Version 0.6.0" all jpg file changes are also applied to the xmp sidecarfile (which is created if necessary). You can copy all newly created or modified xmp files back to pc and apply the apmXmp2jpg.cmd which transfer the content of xmp to the jpg. You can use the xmp-file date to decide which xmp-files to copy. See apmXxxx.cmd below.
A Photo Manager writes a log file /storage/sdcard0/copy/aPhotomanager.log that conantain all file operations on images as call apmXXX.cmd /path/to/file.jpg parameter
.
There is a sub batch for every possible jpg operation: apmCopy.cmd, apmMove.cmd, apmDelete.cmd, apmGps.cmd, apmTagsRemove.cmd, apmTagsAdd.cmd See apmXxxx.cmd below.
You can
- copy this log to pc,
- rename it to aPhotomanager.log.cmd
- and replace the absolute paths to relative paths that match the image root on pc
- and execute that batch to apply the changes made on android to the pc files
Since "A Photo Manager Version 0.6.0" all jpg file changes are also logged to an android database "transactionlog" that contain the same infos as /storage/sdcard0/copy/aPhotomanager.log. This info will be used to create Pc app specific sync adapters. If someone wants to implemnt a syncadapter for the pc photomanager digigam the data to be transfered from android to pc could be selected and transfered from this table.
PC software : IrfanView, ExifTool, apmXxxx.cmd, apmXxxx.args
If you want to sync meta data between pc and android you need some pc software that generates data to be transfered to android and to apply changes received from android.
Irfanview is a tool that can downscale images through folder hirachies and preserves the meta data. It can be downloaded here. My android images are a scaled down version with 1024 x Xxx or Xxx x 1024 resolution which
- require much less space
- are faster to display without the need to have memory consuming precalculated miniatur images in gallery view (thumbnails)
I have created some pc batchfiles apmXxxx.cmd for MS Windows to process jpg meta data that can be downloaded from https://github.com/k3b/APhotoManager/blob/master/fotolib2/src/test/resources/de/k3b/media/ .
These batches needs installed commandlinetool ExifTool which can be downloaded here Copy the batches into the ExifTool install dir and make shure that this directory is included in the seach path.
- apmXmp2Jpg.cmd
- transfers meta data from one xmp sidecar file back to it-s jpg
- example:
apmXmp2Jpg.cmd path/to/file.jpg
adds content of path/to/file(.jpg).xmp to file.jpg - apmXmp2jpg.args define how xmp meta data are mapped to jpg exif/iptc data
- must be copied to the same directory as apmXmp2Jpg.cmd
- apmJpg2xmp.cmd
- transfers meta data from jpg file to xmp sidecar file. Updates existing or creates new xmp file.
- example:
apmJpg2xmp.cmd path/to/file.jpg
updates/creates path/to/file(.jpg).xmp - apmJpg2xmp.args define how jpg exif/iptc meta data are mapped to xmp data
- must be copied to the same directory as apmJpg2xmp.cmd
- apmGps.cmd
- set geo location (latitude/longitude) data to jpg/xmp file
- Example
CALL apmGps path/to/file.jpg 53.169414 8.627358
sets geo info to file.jpg and to file(.jpg).xmp (if xmp exists)
- apm2Csv.cmd generates csv with meta data of all xmp/jpg of current directory and subdirectories. Execute in pc image root directory
- apmCopy.cmd
- copy image and corresponding xmp from one directory to an other
- Example
CALL apmCopy path/to/some/file.jpg path/to/otherfile.jpg
copy file.jpg and file(.jpg).xmp (if xmp exists) to an other directory
- apmMove.cmd
- move image and corresponding xmp from one directory to an other or renames it.
- Example
CALL apmMove path/to/some/file.jpg path/to/other/file.jpg
move file.jpg and file(.jpg).xmp (if xmp exists) to an other directory - Example
CALL apmMove path/to/oldFileName.jpg path/to/newFileName.jpg
rename oldFileName.jpg and oldFileName(.jpg).xmp (if xmp exists) to newFileName.*
- apmDelete.cmd
- delete image and corresponding xmp
- Example
CALL apmDelete path/to/some/file.jpg
deletes file.jpg and file(.jpg).xmp (if xmp exists)
- apmTagsAdd.cmd
- add tags(keywords) to jpg and xmp.
- Example
call apmTagsAdd path/to/some/file.jpg "peter" "harbour"
adds the tags "peter" and "harbour" to the already existing tags of file.jpg and file(.jpg).xmp (if xmp exists)
- apmTagsRemove.cmd
- remove tags(keywords) from jpg and xmp.
- Example
call apmTagsRemove path/to/some/file.jpg "peter" "harbour"
removes the tags "peter" and "harbour" to file.jpg and file(.jpg).xmp (if xmp exists)
English:
- Homepage
- Download
- Walk Through: Gallery, Filter, Map, Folder picker
- Overview
- How to search/find/filter Photos
- Gallery-View
- Geographic-Map
- Image-View
- edit properties (exif) of photo(s).
- Filter-View
- Tags
- Virtual Albums/Bookmarks
- Folder-Picker
- AutoProcessing Automatic rename/apply exif on move/copy
- Settings
- Backup to zip
- History
- Technical infos
- supported photo properties (exif,xmp,iptc)
- Intent API for other apps to use APhotoManager
- Howtos
- Protect-mode (Extended App Pinning): Limit photos a user can see
- geotag-multible-photos
- Incremental Photo backup
- Workflow: Camera + move + rename + exif(tag, geo) to pc
- pc android photo properties (exif) sync
- Remote Problem Analysis Create a Logfile
- Filter Drill Down: Working with Picker Show-In-New
- Android 10
Other languages:
- ar Arabic العربية
- de German Deutsch
- es Spanish Espanol
- eu Basque Euskara
- fr French Français
- id Indonesian Indonesia
- it Italian Italianio
- ja Japanese 日本人
- nl Dutch Nederlands
- pt Portuguese Português, Brasil
- ro Romanian Român
- tr Turkish Türk
- uk Ukrainian Українська
- zh-CN Chinese traditional 繁体中文
- zh-TW Chinese simplified 简体中文