Home - RalfDetzler/media-importer GitHub Wiki

Welcome to the media-importer wiki! Media-importer provides an easy import of new photos and videos from smartphone, connected via USB.

Usage

You right click on the DCIM folder of the connected smartphone in Windows Explorer and select the Context Menu Entry "Import Media". All new and newer media files on the smartphone are copied to the Windows Library for photos, organized by year and month.

Example

A new photo DCIM/IMG_0443.JPG from Nov'2017 is copied to C:\Users\your-user\Pictures\2017\11\IMG_0443.JPG.

How does it work

Media-Importer starts the PowerShell script "media-importer.ps1" with the name of the folder as parameter.

Media-importer then scans all files of the smartphone folder recursively and builds a target filename. The target filename shows into the Windows Photo Library of the user, followed by a folder for the year and a subfolder for the month, the picture has been taken. When the target file does not exist, or when the target file is older then the file on the smartphone, the file is copied. Otherwise, it is skipped.

Ignore unwanted Photos

Due to also WhatsApp photos and Telegram photos are stored on the smartphone, you get lots of photos, you don't want to keep in your photo library. If you delete them after an import, they will reappear when you start media-importer again. To solve this, there is another Context Menu Entry "Mark Deleted" in Windows Explorer. When you select this on a file, the file is moved to a ".deleted" folder in the photo library and the filename is inserted into a 'marked-for-deletion.csv' file inside the data folder of media-importer. Media-importer does no longer import files, that are contained in that 'marked-for-deletion.csv' file.

Data Folder and Setup

Media-importer stores some index files on the disk of the computer. Please set an environment variable "media_importer_data" that points to a folder, where you want to store the media-importer files. You can do this for example in the Windows Photo Library: C:\Users\your-username\Pictures\media-importer-data.

Inside the media-importer scripts, this is referenced by: $env:media_importer_data

Programming Details

Media-importer is provided as a collection of PowerShell scripts. For details see Programming Details.