Created
June 7, 2013 10:24
-
-
Save 0xRoch/5728389 to your computer and use it in GitHub Desktop.
Playframework - Scala GIF Pixel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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