drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.56k stars 480 forks source link

GraalVM native image support #504

Open AlexITC opened 3 years ago

AlexITC commented 3 years ago

Apparently, this library (or its underlying libraries) depend a lot on reflection, which causes problems while including metadata-extractor on native images.

A potential approach is to declare the classes required by the reflection usage with the AutomaticFeature annotation as specified by the docs.

Related issue: https://github.com/wiringbits/my-photo-timeline/issues/1, there I have tried to get the necessary classes included, but there are still some others missing (related to com.sun.org.apache.xerces.internal.impl.msg.SAXMessages).

Thanks!

drewnoakes commented 3 years ago

depend a lot on reflection

This library's code doesn't use any reflection code as far as I'm aware. We do depend upon the XMP Core library, which appears to indirectly use reflection for some XML APIs.

Ideally such a declaration of such types used via reflection would exist in or alongside that upstream dependency.

If that is not an option and you believe the file would be of general use to others, a pull request would be welcome.

AlexITC commented 3 years ago

I'll try including the complete library on the native build, and see how it goes.

Thanks for the hint.