@ParametersAreNonnullByDefault public class AvatarTranscoderImpl extends Object implements AvatarTranscoder
| Constructor and Description |
|---|
AvatarTranscoderImpl(AvatarTagger avatarTagger,
AvatarFileStoreProvider avatarFileStoreProvider) |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.dc.filestore.api.FileStore.Path |
getOrCreateRasterizedAvatarFile(Avatar avatar,
Avatar.Size size,
InputStream inputStream)
Creates a PNG image file for the given avatar based on the base avatar image file which should be in SVG format.
|
void |
transcodeAndTag(InputStream inputStream,
OutputStream outputStream)
Converts given SVG data to PNG format.
|
byte[] |
transcodeAndTag(String imageKey,
InputStream inputStream,
Avatar.Size size)
Converts a given SVG data to PNG format.
|
public AvatarTranscoderImpl(AvatarTagger avatarTagger, AvatarFileStoreProvider avatarFileStoreProvider)
public com.atlassian.dc.filestore.api.FileStore.Path getOrCreateRasterizedAvatarFile(Avatar avatar, Avatar.Size size, InputStream inputStream) throws IOException
AvatarTranscodergetOrCreateRasterizedAvatarFile in interface AvatarTranscoderavatar - to be transcodedsize - of requested rasterinputStream - the data of the avatar to be transcodedIOExceptionpublic void transcodeAndTag(InputStream inputStream, OutputStream outputStream) throws IOException
AvatarTranscoderAvatar.Size.MEDIUM.transcodeAndTag in interface AvatarTranscoderinputStream - to be convertedoutputStream - to which the result should be writtenIOExceptionpublic byte[] transcodeAndTag(String imageKey, InputStream inputStream, Avatar.Size size) throws IOException
AvatarTranscoder
This method will save the converted image to disk so that if the method is invoked
once again with the same imageKey and size the previous result will
be returned. Therefore it is very important to choose imageKey carefully -
it should uniquely identify the image.
transcodeAndTag in interface AvatarTranscoderimageKey - name of the file thatinputStream - svg datasize - size of the outputIOExceptionCopyright © 2002-2024 Atlassian. All Rights Reserved.