org.jaudiotagger.tag.id3.valuepair
Class ImageFormats

java.lang.Object
  extended by org.jaudiotagger.tag.id3.valuepair.ImageFormats

public class ImageFormats
extends java.lang.Object

Represents the image formats support by ID3, provides a mapping between the format field supported in ID3v22 and the mimetype field supported by ID3v23/ID3v24.


Field Summary
private static java.util.Map<java.lang.String,java.lang.String> imageFormatsToMimeType
           
private static java.util.Map<java.lang.String,java.lang.String> imageMimeTypeToFormat
           
static java.lang.String MIME_TYPE_BMP
           
static java.lang.String MIME_TYPE_GIF
           
static java.lang.String MIME_TYPE_JPEG
           
static java.lang.String MIME_TYPE_JPG
          Sometimes this is used for jpg instead :or have I made this up
static java.lang.String MIME_TYPE_PNG
           
static java.lang.String V22_BMP_FORMAT
           
static java.lang.String V22_GIF_FORMAT
           
static java.lang.String V22_JPG_FORMAT
           
static java.lang.String V22_PNG_FORMAT
           
 
Constructor Summary
ImageFormats()
           
 
Method Summary
static boolean binaryDataIsBmpFormat(byte[] data)
           
static boolean binaryDataIsGifFormat(byte[] data)
           
static boolean binaryDataIsJpgFormat(byte[] data)
           
static boolean binaryDataIsPngFormat(byte[] data)
           
static java.lang.String getFormatForMimeType(java.lang.String mimeType)
          Get v2.2 format from v2.3 mimetype
static java.lang.String getMimeTypeForBinarySignature(byte[] data)
           
static java.lang.String getMimeTypeForFormat(java.lang.String format)
          Get v2.3 mimetype from v2.2 format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

V22_JPG_FORMAT

public static final java.lang.String V22_JPG_FORMAT
See Also:
Constant Field Values

V22_PNG_FORMAT

public static final java.lang.String V22_PNG_FORMAT
See Also:
Constant Field Values

V22_GIF_FORMAT

public static final java.lang.String V22_GIF_FORMAT
See Also:
Constant Field Values

V22_BMP_FORMAT

public static final java.lang.String V22_BMP_FORMAT
See Also:
Constant Field Values

MIME_TYPE_JPEG

public static final java.lang.String MIME_TYPE_JPEG
See Also:
Constant Field Values

MIME_TYPE_PNG

public static final java.lang.String MIME_TYPE_PNG
See Also:
Constant Field Values

MIME_TYPE_GIF

public static final java.lang.String MIME_TYPE_GIF
See Also:
Constant Field Values

MIME_TYPE_BMP

public static final java.lang.String MIME_TYPE_BMP
See Also:
Constant Field Values

MIME_TYPE_JPG

public static final java.lang.String MIME_TYPE_JPG
Sometimes this is used for jpg instead :or have I made this up

See Also:
Constant Field Values

imageFormatsToMimeType

private static java.util.Map<java.lang.String,java.lang.String> imageFormatsToMimeType

imageMimeTypeToFormat

private static java.util.Map<java.lang.String,java.lang.String> imageMimeTypeToFormat
Constructor Detail

ImageFormats

public ImageFormats()
Method Detail

getMimeTypeForFormat

public static java.lang.String getMimeTypeForFormat(java.lang.String format)
Get v2.3 mimetype from v2.2 format

Parameters:
format -
Returns:

getFormatForMimeType

public static java.lang.String getFormatForMimeType(java.lang.String mimeType)
Get v2.2 format from v2.3 mimetype

Parameters:
mimeType -
Returns:

binaryDataIsPngFormat

public static boolean binaryDataIsPngFormat(byte[] data)
Parameters:
data -
Returns:
true if binary data matches expected header for a png

binaryDataIsJpgFormat

public static boolean binaryDataIsJpgFormat(byte[] data)
Parameters:
data -
Returns:
true if binary data matches expected header for a jpg Some details http://www.obrador.com/essentialjpeg/headerinfo.htm

binaryDataIsGifFormat

public static boolean binaryDataIsGifFormat(byte[] data)
Parameters:
data -
Returns:
true if binary data matches expected header for a gif

binaryDataIsBmpFormat

public static boolean binaryDataIsBmpFormat(byte[] data)
Parameters:
data -
Returns:
true if binary data matches expected header for a bmp

getMimeTypeForBinarySignature

public static java.lang.String getMimeTypeForBinarySignature(byte[] data)
Parameters:
data -
Returns:
correct mimetype for the image data represented by this byte data