My users upload photos to a jServer WebApp. Before storing a photo, I would like to remove all meta data i.e. GPS location, camera model from EXIF. Therefore, I try to convert JPG to PNG by using this simple code:
The code compiles with jFX but it fails at runtime because jFX can not be used on a jServer:
How can I convert a JPG to PNG on a jServer? How can I work with Images in general on a jServer (i.e. resize, rotate)?
B4X:
Dim insPhoto As InputStream
Dim imgPhoto As Image
Dim outPhoto As OutputStream
' Read Source, i.e. JPG
insPhoto = File.OpenInput(strDirSource, strFileSource)
imgPhoto.Initialize2(insPhoto)
' Write as PNG without EXIF metadata
outPhoto = File.OpenOutput(strDirTarget, strFileTarget, False)
imgPhoto.WriteToStream(outPhoto)
The code compiles with jFX but it fails at runtime because jFX can not be used on a jServer:
B4X:
java.lang.NoClassDefFoundError: javafx/scene/image/Image
Caused by: java.lang.ClassNotFoundException: javafx.scene.image.Image
How can I convert a JPG to PNG on a jServer? How can I work with Images in general on a jServer (i.e. resize, rotate)?