I have taken a lot of photos over the years and things have just piled up and I’ve amassed about 2TB worth of images.
In an effort to get organized, I decided the first step is to reduce the number of images by finding duplicates and also getting rid of the RAW files (CR2, DNG, TIF).
Step One: Removing RAW files
I’ve created a script that will recursively process files in my photo storage directory and convert RAW files to JPEG and then go through and remove the RAW files. I was able to free up about 500GB of storage space by removing the RAW files.
Mogrify is required and is what I use to convert and preserve time stamp as I will later organize photos by date/time.
Convert
@echo off
call :treeProcess
goto :eof
:treeProcess
echo "%CD%"
for %%f in (*.cr2) do (
if not exist "%%~nf.jpeg" (
echo %%f
mogrify -format jpeg -quality 75 -define preserve-timestamp=true "%%f"
)
)
for /D %%d in (*) do (
cd %%d
call :treeProcess
cd ..
)
Cleanup
@echo off
call :treeProcess
goto :eof
:treeProcess
echo "%CD%"
for %%f in (*.cr2) do (
if exist "%%~nf.jpeg" (
echo deleting "%%f"
del /s /f "%%f"
) else (
echo WARN found RAW but no converted JPEG "%%f"
)
)
for /D %%d in (*) do (
cd %%d
call :treeProcess
cd ..
)
I did these for my DNG and TIF files also.
Step Two: Cleaning up Duplicates
For this task, I found a tool called czkawkas and wrote a little about it here. It works well. This process freed up an additional ~10GB. So far, about 512GB of removed unnecessary images.