KilianB / JImageHash

Perceptual image hashing library used to match similar images
MIT License
397 stars 80 forks source link

Logging #43

Open lbispham opened 4 years ago

lbispham commented 4 years ago

Can you remove this log message or at least set it to debug level instead of info? It's clogging up the log files when we process lots of images. Is there actually any action that we can take when a BufferedImage has an unrecognized type?

"com.github.kilianB.graphics.FastPixel create INFO: No fast implementation available for 13. Fallback to slow default variant."

KilianB commented 4 years ago

If the same image is processed multiple times you could convert it to a known format beforehand once.

BufferedImage in = ImageIO.read(new File("2Linepdftojpeg.jpeg"));

//Convert image since input type is a weird custom format
BufferedImage newImage = new BufferedImage(in.getWidth(), in.getHeight(), BufferedImage.TYPE_INT_RGB);

Graphics2D g = newImage.createGraphics();
g.drawImage(in, 0, 0, null);
g.dispose(); 

//save to disk
...

Up until the end of the week I do not have access to my development station, therefore I can't upload and sign any binaries. For the time being you should be able to simply mute the logger.

java.util.logging.Logger;
Logger logger = Logger.getLogger(FastPixel.class.getSimpleName());
logger(Level.OFF);

I am not really happy about the dependency of the project. I had a larger rework planned to add support for alpha channel images #38. JavaFX should be removed or made optional due to it not being bundled in the official java release. Maybe it's time to update the codebase :)