Skip to content

PSReadExif is a PowerShell module that reads EXIF metadata from image files using native Windows GDI+ classes.

License

Notifications You must be signed in to change notification settings

nmbell/PSReadExif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSReadExif 1.0.2

SHORT DESCRIPTION

LONG DESCRIPTION

QUICK START GUIDE

  1. Install the module.

  2. Run your first command.

RELEASE HISTORY



SHORT DESCRIPTION

PSReadExif is a PowerShell module that reads EXIF metadata from image files using native Windows GDI+ classes.



LONG DESCRIPTION

PSReadExif is a PowerShell module that reads EXIF metadata from image files using native Windows GDI+ classes.

Some image file metadata can be viewed in Windows Explorer's properties dialog, however, that data is not available natively as PowerShell file object properties. The [System.Drawing.Bitmap] class (part of the GDI+ Win32 API) allows access to a range of 217 EXIF metadata properties as binary data arrays. The functions of this module use the class to access the EXIF metadata and then decode it into meaningful (human readable) form. PSReadExif cannot be used to modify or create EXIF metadata.

Note: While the 217 available metadata properties cover a lot of commonly used data points, many more exist (ExifTool documentation notes that it recognizes more than 25,000). If you need to read image metadata that is not exposed with PSReadExif, or write any image metadata, it's recommended to use ExifTool or another metadata editor.

The module functions



QUICK START GUIDE

1. Install the module.

The module is available through the PowerShell Gallery. Run the following command in a PowerShell console to install the module:

Install-Module -Name PSReadExif -Force

Run the following to import the module into the current session:

Import-Module -Name PSReadExif

To see the list of available commands:

Get-Command -Module PSReadExif

If you see a list of functions similar to those above, your install was successful.

2. Run your first command.

To read EXIF metadata from a file:

$Path = 'C:\my\images\Canon.jpg'
Get-ExifData -Path $Path

For more examples, see the Get-ExifData function help.

To add EXIF metadata as properties of a file object:

$Path = 'C:\my\images\Canon.jpg'
Get-Item -Path $Path | Add-ExifData | Select-Object -ExpandProperty ExifData

For more examples, see the Add-ExifData function help.



EXAMPLES

Rename all jpeg images in a directory using the date the image was taken:

Get-ChildItem -Filter *.jpg | Add-ExifData | Where-Object { $_.ExifData.DateTimePS } | Rename-Item -NewName { $_.ExifData.DateTimePS.ToString('yyyyMMdd_HHmmss')+$_.Extension }

Find all images in a directory taken in horizontal format:

Get-ChildItem | Add-ExifData | Where-Object { $_.ExifData.Orientation -like 'Horizontal*' }


RELEASE HISTORY

1.0.2 (2022-08-05)

  • Handle a divide by zero error

1.0.1 (2022-06-11)

  • Add call to Dispose() method
  • Add examples in about_PSReadExif

1.0.0 (2022-06-10)

  • Initial release

About

PSReadExif is a PowerShell module that reads EXIF metadata from image files using native Windows GDI+ classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published