Within the image-handling system,
There is a process to generate the original image and its thumbnail image.
Thumbnail image generation method is java.
BufferedImage newBimg = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_3BYTE_BGR);
newBimg.getGraphics().drawImage(ImageIO.read(originalImage))).getScaledInstance(newWidth, newHeight, Image.SCALE_AREA_AVERAGING), 0, 0, newWidth, newHeight, null);
ImageIO.write(newBimg, "jpg", new File(thumbnailImg.getAbsolutePath()));
Is there a way to compare the two image files without regenerating the thumbnail image to determine that they are the same image if the filenames of each other fall apart after generation?
I checked ImageMagic's compare command, but it seemed that only images of the same size could be determined.
I also considered using the Linux od command to read and compare the binary data of the images, but it seems that the common parts of the images are not constant, so I couldn't do it well when I wanted to judge multiple images at once.
Please let me know if there is a good way.
Thank you for your cooperation.
Is there a way to compare the two image files without regenerating the thumbnail image to determine that they are the same image?
There is no universal means.
Furthermore, "re-create thumbnail images" cannot output the same thumbnail image file unless the operating environment is completely fixed, so simple byte comparison cannot determine the same image.
© 2024 OneMinuteCode. All rights reserved.