Class CoverDecoder

java.lang.Object
lol.trq.orpheus.cover.CoverDecoder

public final class CoverDecoder extends Object
Turns encoded image bytes into a Cover. Input is untrusted: anything odd gives null, never an exception.
  • Field Details

  • Method Details

    • decode

      public static Cover decode(String key, byte[] data, int maxSide)
      Decodes and scales an image so that its longer side is at most maxSide.
      Returns:
      the cover, or null when the data is not a readable image, is too large, or the runtime has no image support
    • format

      public static String format(byte[] d)
      The format the data starts like, or null. Other formats a host has readers for are not decoded.