Package de.aikiit.fotorenamer.image
Class CreationDateFromExifImageRenamer
java.lang.Object
de.aikiit.fotorenamer.image.CreationDateFromExifImageRenamer
- All Implemented Interfaces:
Runnable
This class transforms picture file names. All relevant files
in the target directory get a new file name - if correct
metadata can be extracted from the files' EXIF file headers.
A picture
Files without EXIF metadata are not touched at all.
A picture
foo.jpg
is renamed to
201108111100_foo.jpg
if the picture's creation date
was 2011-08-11 11:00.
Files without EXIF metadata are not touched at all.
- Version:
- 2011-06-02, 13:22
- Author:
- hirsch
-
Constructor Summary
ConstructorsConstructorDescriptionCreationDateFromExifImageRenamer
(String targetDirectory) The given directory is scanned for image files that are processed. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
renameImage
(File imageFile) Extracts creation date from EXIF information and returns new filename.final void
run()
Performs the renaming and updates the UI.
-
Constructor Details
-
CreationDateFromExifImageRenamer
public CreationDateFromExifImageRenamer(String targetDirectory) throws InvalidDirectoryException, NoFilesFoundException The given directory is scanned for image files that are processed.- Parameters:
targetDirectory
- Name of the directory to work on.- Throws:
InvalidDirectoryException
- If there's a problem with the directory selected.NoFilesFoundException
- if the selected directory is empty.
-
-
Method Details
-
renameImage
Extracts creation date from EXIF information and returns new filename. If an error occurs during EXIF data extraction the original filename is returned.- Parameters:
imageFile
- Filename to renameFiles according to the subclass implementation.- Returns:
- New filename that includes the image's creation date.
- See Also:
-
for more information about the file format.
-
run
public final void run()Performs the renaming and updates the UI. All error handling is done in other methods.
-