I am wanting to build an application to allow me to manage my photos/images. One feature I would like to have is to quickly determine duplicates, the way I am wanting to do this is to narrow down the search quickly by only reading the dimensions and probably the creation date first which will drastically narrow down the search so I can then do more intensive verification methods.
I only know how to get an image's dimensions once it has been loaded into a BufferdImage which does not contain any other metadata that may be useful - This is even more impractical as loading images is what I want to avoid for the fast search (as the loading is slow).
Is there any way to do this? Preferably using Java's API such as the File class? I will only use a library if I have to.
Asked
Active
Viewed 77 times
1

Lee Fogg
- 775
- 6
- 22
-
1If you are looking for exact duplicates (file copies) then you might start with comparing the file size. I'm pretty sure you can get that in Java without reading the entire file first. – Jongware Aug 17 '14 at 00:13
1 Answers
0
What you need to load is the Exif data. I found a Java library to handle it in this Stack Overflow question: ImageIO - get image type and exif data
The library is at https://drewnoakes.com/code/exif/

Community
- 1
- 1

markbernard
- 1,412
- 9
- 18