-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When sorting images by date, important when mixing images from different sources, the converted files have the date of the conversion and not the date of the original file. Please change the Date Created and Date Modified to match the original file.
Proposed Modification:
Process
{
# store input file's dates and set them on the detination file
$fileCreateDate = $null;
$fileModifiedDate = $null;
$outFileName = ""
# Summary of imaging APIs: https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/imaging
foreach ($file in $Files)
{
**$outFileName = ""**
# Get SoftwareBitmap from input file
$file = Resolve-Path -LiteralPath $file
**$fileCreateDate = (Get-Item $file).CreationTime # Malcolm Stewart
$fileModifiedDate = (Get-Item $file).LastWriteTime # Malcolm Stewart**
**# $outputFileName = $inputFile.Name + ".jpg";
$outputFileName = $inputFile.Name -replace $inputFile.FileType, ".jpg"; # Malcolm Stewart ... new file is mypic.jpg instead of mypic.heic.jpg
$outFileName = "$($inputFolder.Path)\$outputFileName"**
finally
{
# Clean-up
if ($inputStream -ne $null) { [System.IDisposable]$inputStream.Dispose() }
if ($outputStream -ne $null) { [System.IDisposable]$outputStream.Dispose() }
**if ($outFileName -ne "")
{
(Get-Item $outFileName).CreationTime = $fileCreateDate # Malcolm Stewart
(Get-Item $outFileName).LastWriteTime = $fileModifiedDate # Malcolm Stewart
}**
toochewie
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request