Skip to content

harlo/j3mifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

j3mifier

j3m parser

Overview

j3mifier is a command line utility that extracts and unpacks j3m metadata from the host media file. The host media file is then converted to a set of internet ready formats and dimensions.

Building and running

run: mvn clean install
to skip tests, run mvn clean install -Dmaven.test.skip=true

Use j3mifier is called from command line: sudo java -cp .:/opt/j3m/framework/:/opt/j3m/jars/*:/opt/j3m/conf/ framework.MediaProcessor <input_file> <output_folder>

The j3mfier process the <input_file> and places the following files in the <output_folder>:

  • original media sans metadata attachment
  • small resolution version of original media, denoted by the "low" file name prefix
  • medium resolution version of original media, denoted by the "med" file name prefix
  • high resolution version of original media, denoted by the "high" file name prefix
  • a still image, if the original media was a video file.
  • a thumbnail image, denoted by the "thumb" file prefix
  • a json file containing the j3m metadata that was attached to the media.
  • a json file containing keywords extracted from the j3m metadata, denoted by the "keywords" file name prefix.

Mandatory Parameters: <input_file> - the full path to the media file to be processed

<output_folder> - the full path to the folder where all created files should be placed

Optional Parameters: these may be added to the command line AFTER the mandatory <input_file> and <output_folder> parameters.

-d : debug mode - leaves the file trail generated by the metadata unpacking process

-v : verbose mode turned on. Causes more messages to be written to stdout, this is also a property in the conf file. It is suggested it be set to 'false' in the conf file, and turned on via command line for testing

-l : lenient mode turned on. Causes errors and exceptions during j3m unpacking and verification to be ignored. This is a property that can be set via the conf file.

Advanced Configuration A lot of the j3mifier behaviour is dictated by the conf file: <j3mifier_install_folder>/conf/conf.properties

The following settings are availabe:

  • Recognised file extension to identify image and video files.
  • Video and image resolutions for the small,med,large output files
  • The json path to the keyword locations in the j3m
  • Words to be excluded from key words
  • The json path the the pgp signature, and metadata it was applied to.
  • The json path to the media hashes locations in the j3m
  • The text warning to display in case of hash mismatch
  • command line calls to utilities used by the j3mifier, such as ffpmpeg, gpg, and the j3mparser

Unpacking process

When j3m metadata is attached to the host media file it is packaged in a number of steps including signing, compression, encryption and base64 encoding. During the unpacking process, the j3mifier performs the following steps:

  1. Base64 decode
  2. GPG decrypt, if the PGP header is present in file
  3. Ungzip the file.
  4. If a PGP signature is included (as per the path defined in the properties), it is extracted into a separate file and used to verify the metadata.
  5. keywords are extracted and written to a file.

The -d flag ensures that all the files generated by steps 1-4 are not deleted, and are available for inspection/debugging.

Releases

No releases published

Packages

No packages published

Languages