Skip to content
fredrik-rambrisPublic

About

Java library for reading and writing Amiga IFF files (ILBM, 8SVX) via standard JDK plugin systems (ImageIO, AudioSystem)

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

java-iff

CI Maven Central License

A Java library for reading and writing Electronic Arts IFF (Interchange File Format) files, with codecs for ILBM images and 8SVX audio. It plugs into the standard JDK plugin systems, so once registered, ILBM/8SVX files can be read and written through javax.imageio.ImageIO and javax.sound.sampled.AudioSystem like any other supported format.

Modules

  • dev.rambris.iff — generic IFF FORM reader/writer (IffReader, IffWriter) and chunk primitives.
  • dev.rambris.iff.codec — IlbmCodec (ILBM images) and Svx8Codec (8SVX audio), plus their data records (IlbmImage, Svx8Sound, BmhdChunk, VhdrChunk).
  • dev.rambris.iff.imageio — javax.imageio SPI: IlbmImageReader/IlbmImageWriter.
  • dev.rambris.iff.audio — javax.sound.sampled SPI: Svx8AudioFileReader/Svx8AudioFileWriter.

The SPI providers are registered under META-INF/services, so they're discovered automatically by ImageIO/AudioSystem as soon as this jar is on the classpath — no manual registration needed.

Installation

<dependency>
    <groupId>dev.rambris</groupId>
    <artifactId>iff</artifactId>
    <version>1.0.0</version>
</dependency>

Requires Java 17 or newer.

Usage

Direct codec API

IlbmImage image = IlbmCodec.read(Path.of("picture.iff"));
Svx8Sound sound = Svx8Codec.read(Path.of("sample.8svx"));

IlbmCodec.write(image, Path.of("out.iff"));
Svx8Codec.write(sound, Path.of("out.8svx"));

Through ImageIO

BufferedImage image = ImageIO.read(new File("picture.iff"));
ImageIO.write(image, "ILBM", new File("out.iff"));

Through AudioSystem

AudioInputStream stream = AudioSystem.getAudioInputStream(new File("sample.8svx"));
AudioSystem.write(stream, Svx8AudioFileTypes.SVX8, new File("out.8svx"));

Low-level IFF access

For formats this library doesn't have a dedicated codec for, IffReader/ IffWriter give direct access to FORM chunks:

String formType = new IffReader()
        .on(IlbmId.BMHD, (id, data) -> bmhd = BmhdChunk.parse(data))
        .on(IlbmId.BODY, (id, data) -> body = data)
        .read(path);

GraalVM native image

Reflection/resource configuration for native-image is shipped under META-INF/native-image/dev.rambris/iff/ and picked up automatically.

Building

./mvnw verify

Contributing

Issues and pull requests are welcome at https://github.com/fredrik-rambris/java-iff.

License

Licensed under the Apache License, Version 2.0.

About

Java library for reading and writing Amiga IFF files (ILBM, 8SVX) via standard JDK plugin systems (ImageIO, AudioSystem)

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages