项目作者: flolilo

项目描述 :
(Batch-)Convert pictures to JPEG and/or transfer/delete/add metadata using ImageMagick & exiftool.
高级语言: PowerShell
项目地址: git://github.com/flolilo/picture_tool.git
创建时间: 2018-03-13T12:18:24Z
项目社区:https://github.com/flolilo/picture_tool

开源协议:BSD 3-Clause Clear License

下载


picture_tool

A tool that works with ExifTool and ImageMagick to let you convert pictures to JPEG and/or transfer metadata. Also, processed files can be moved to the Recycle Bin with bdukes’s Remove-ItemSafely.

Need help with the script?

  1. # Simply start its help:
  2. Get-Help .\picture_tool.ps1 -Detailed

Unit testing completed!

All non-generic commands are tested to their extremes with Pester - unicode-signs, brackets, spaces - nothing should break this code now!
Test it for yourself:

  1. # Comment out the script-start:
  2. (Get-Content .\picture_tool.ps1).replace("Start-Everything -UserParams `$UserParams","# Start-Everything -UserParams `$UserParams") | Set-Content .\picture_tool.ps1 -Encoding UTF8
  3. Start-Sleep -Milliseconds 100
  4. # Testing with Pester:
  5. Invoke-Pester .\picture_tool.tests.ps1 -CodeCoverage .\picture_tool.ps1
  6. # Uncommenting:
  7. Start-Sleep -Milliseconds 100
  8. (Get-Content .\picture_tool.ps1).replace("# Start-Everything -UserParams `$UserParams","Start-Everything -UserParams `$UserParams") | Set-Content .\picture_tool.ps1 -Encoding UTF8

As far as I have tested, it even works with PowerShell Core/6!

Troubleshooting

  • If non-ASCII characters give your script trouble, it might be that it was saved with the wrong encoding. Unfortunately, PowerShell needs UTF8 with BOM to function properly (that is: most of the time, it works perfecly well without it, but once in a while, it will break). To check this, I recommend using either Notepad++ or VSCode (though any advanced text editor will do the job). There, you can change the encoding to UTF with BOM.

  • If the script does not open on your Computer running Windows 7 (or earlier): You need at least PowerShell v3 running on your OS, so get WMF 5.1. Also, you need the Recycle-Module.