Help support TMP


"Recover Image Number" Topic


5 Posts

All members in good standing are free to post here. Opinions expressed here are solely those of the posters, and have not been cleared with nor are they endorsed by The Miniatures Page.

Please don't call someone a Nazi unless they really are a Nazi.

For more information, see the TMP FAQ.


Back to the Computer Stuff Plus Board


Areas of Interest

General

Featured Hobby News Article


Featured Link


Featured Ruleset

Toying With Destruction


Rating: gold star gold star gold star gold star gold star gold star gold star gold star 


Featured Showcase Article

Modular Buildings from ESLO

ESLO Terrain explains about their range of modular buildings.


Featured Workbench Article

Fidgeting With Paint

Can a silicone fidget be your next paint palette?


Featured Profile Article

Editor Gwen Says Thanks

Personal logo Editor Gwen The Editor of TMP thanks you for your donations.


Featured Book Review


622 hits since 8 Nov 2021
©1994-2025 Bill Armintrout
Comments or corrections?

Personal logo Old Contemptible Supporting Member of TMP08 Nov 2021 2:41 a.m. PST

I thought I was getting ahead of the curve by renaming my photos from the cameras image number to captions. Big mistake on my part. Over a hundred photographs and I don't know what order they go in. I transferred the images from my camera to windows 10. So I can't go back to my camera to reload them. Is there a way I can retrieve the image number?

Personal logo etotheipi Sponsoring Member of TMP08 Nov 2021 5:38 a.m. PST

Probably not. All the files have a date stamp on them (when the file was created accordint to the system used). Usually, your transfer would preserve that. You should be able to sort them by date.

There is also likely other metadata in the file (information other that the encoding of the pixels that make the picture). Depending on what you used to take the picture, that could be quite extensive and may be useful.

If you are using a realtively modern system for file storage, you can also add to the metadata, which is better for sorting than the filename. For example:

Dave-Doug-AwesomeCon.jpg
Doug-Date-StupidCon.jpg

will sort apart, but if you put the words in metadata, you can easily filter by "Dave", or "Dave" and "Doug", or "*Con".

While people call metadata "semantic" (thanks to a computer nerd, one of my own kind), it is not. It is syntactic. Practically, that means if you think through how you want to "tag" (apply metadata) things, you can get some really good results. If you don't think through how you want to organize the books on your self, you may never be able to find a book you know you have.

Personal logo ColCampbell Supporting Member of TMP08 Nov 2021 7:51 a.m. PST

My solution is to use this system:

yyyy-mm-dd_name of battle or person_xx (representing the sequence of that particular photo in the sequence). Example: 2021-11-06_Napoleonic_game_01 for the first photo in the sequence of photos taken during a recent Napoleonic game.

I then place the photos into dated and named folders.

I do this for just about every kind of file and folder that I have.

Jim

Personal logo Old Contemptible Supporting Member of TMP08 Nov 2021 12:38 p.m. PST

Thanks guys.

Nick Bowler09 Nov 2021 4:43 a.m. PST

Here is a powershell script that will create a directory structure based on the dates in the pictures. You have to modify the from and to fields, and set up permissions for powershell correctly. But this should help.

# PowerShell script to name photos for printing
# Nicholas Armstrong, Jan 2010
# Available at nicholasarmstrong.com
# Renames a folder of photos for printing using the capture date as the file name
# Run 'Set-ExecutionPolicy Unrestricted' from an admistrative prompt before running
# the first time from a computer that hasn't been set to run Powershell scripts

# Modified XXXX, 2012


# Define where we are moving from / to
$from = "C:\Users\XXXX\OneDrive\Pictures"
$to = "E:\Pictures"


#make debugging easier
cls


# Load the assemblies needed for reading and parsing EXIF
Write-Output "Loading Assemblies …"
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") > $null
[System.Reflection.Assembly]::LoadWithPartialName("System.Text") > $null

# Get all the files we want to move
Write-Output "Getting file list …"
$files = Get-ChildItem -include *.jpg -recurse -path $from

# Rename each file
Write-Output "Moving …"
foreach ($file in $files) {

# Get the date for a photo
$year = "0000"
$month = "00"
$day = "00"

if ($file.Extension -eq ".jpg") {
$gotProperty = $FALSE
$photo = [System.Drawing.Image]::FromFile($file.fullname)
try {
$dateProperty = $photo.GetPropertyItem(36867)
$gotProperty = $TRUE
}
catch {
try {
$dateProperty = $photo.GetPropertyItem(306)
$gotProperty = $TRUE
}
catch {
}
}
$photo.Dispose()
if ($gotProperty) {
$encoding = New-Object System.Text.UTF8Encoding
$date = $encoding.GetString($dateProperty.Value).Trim()
$year = $date.Substring(0,4)
$month = $date.Substring(5,2)
$day = $date.Substring(8,2)
}
}
else {
$date = $file.LastWriteTime
$year = $date.year.ToString()
$month = $date.month.ToString()
$day = $date.day.ToString()
if ($month.length -lt 2) {$month = "0" + $month}
if ($day.length -lt 2) {$day = "0" + $day}
}


# Figure out where the file should be
$oldFileName = $file.fullname
$newFilePath = $to + "\" + $year + " pictures\" + $year + $month + "\" + $year + $month + $day
$newFileName = $newFilePath + "\" + $file.name


# Create the directory if needed
if (!(Test-Path -path $newFilePath)) {
New-Item $newFilePath -type directory
}


# Move the file
if (Test-Path -path $newFileName) {
# Write-Host "File exists at " $newFileName " Removing " $oldFileName
# Remove-Item $oldFileName
}
else {
Write-Host "Moved " $oldFileName " to " $newFileName
# Move-Item -path $oldFileName -destination $newFileName
Copy-Item -path $oldFileName -destination $newFileName
}
}


# We are done
Write-Output "Completed."

Sorry - only verified members can post on the forums.