Skip to content

Instantly share code, notes, and snippets.

@0xRoch
Created June 7, 2013 10:24
Show Gist options
  • Save 0xRoch/5728389 to your computer and use it in GitHub Desktop.
Save 0xRoch/5728389 to your computer and use it in GitHub Desktop.
Playframework - Scala GIF Pixel
import org.apache.commons.codec.binary.Base64
def pixel = Action {
val source: String = "R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==";
val byteArray = Base64.decodeBase64(source.getBytes())
Ok(byteArray).as("image/gif")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment