com.atlassian.jira.web.less.inlineimage
Class InlineImageEncoder

java.lang.Object
  extended by com.atlassian.jira.web.less.inlineimage.InlineImageEncoder

public class InlineImageEncoder
extends Object

Translates an image into a base64 data URI for use in Less Transformer.

Since:
v5.2

Field Summary
static ThreadLocal<LessTransformer.LessResource.BaseLoader> resourceLoader
           
 
Constructor Summary
InlineImageEncoder()
           
 
Method Summary
static InlineImage encode(String imagePath)
          Encodes the given image in its base 64 representation.
static InlineImage encodeOptimized(String imagePath)
          Encodes the given image in its base 64 representation, stripping all metadata.
static LessTransformer.LessResource.BaseLoader getLoader()
           
static void setLoader(LessTransformer.LessResource.BaseLoader loader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceLoader

public static ThreadLocal<LessTransformer.LessResource.BaseLoader> resourceLoader
Constructor Detail

InlineImageEncoder

public InlineImageEncoder()
Method Detail

encode

public static InlineImage encode(String imagePath)
Encodes the given image in its base 64 representation.

Parameters:
imagePath - the path to the image to be encoded relative to the classpath.
Returns:
the base 64 representation of the image

encodeOptimized

public static InlineImage encodeOptimized(String imagePath)
Encodes the given image in its base 64 representation, stripping all metadata.

Parameters:
imagePath - the path to the image to be encoded relative to the classpath.
Returns:
the base 64 representation of the image with all metadata stripped.

getLoader

public static LessTransformer.LessResource.BaseLoader getLoader()

setLoader

public static void setLoader(LessTransformer.LessResource.BaseLoader loader)


Copyright © 2002-2013 Atlassian. All Rights Reserved.