Search in sources :

Example 6 with FastThumb

use of im.actor.core.entity.content.FastThumb in project actor-platform by actorapp.

the class AndroidMessenger method sendAnimation.

public void sendAnimation(Peer peer, String fullFilePath) {
    ImageHelper.BitmapSize size = ImageHelper.getImageSize(fullFilePath);
    if (size == null) {
        return;
    }
    Bitmap bmp = BitmapFactory.decodeFile(fullFilePath);
    if (bmp == null) {
        return;
    }
    Bitmap fastThumb = ImageHelper.scaleFit(bmp, 90, 90);
    byte[] fastThumbData = ImageHelper.save(fastThumb);
    sendAnimation(peer, fullFilePath, size.getWidth(), size.getHeight(), new FastThumb(fastThumb.getWidth(), fastThumb.getHeight(), fastThumbData), fullFilePath);
}
Also used : Bitmap(android.graphics.Bitmap) FastThumb(im.actor.core.entity.content.FastThumb) ImageHelper(im.actor.core.utils.ImageHelper)

Aggregations

FastThumb (im.actor.core.entity.content.FastThumb)6 Bitmap (android.graphics.Bitmap)4 JsResizeListener (im.actor.core.js.images.JsResizeListener)2 MediaMetadataRetriever (android.media.MediaMetadataRetriever)1 ImageHelper (im.actor.core.utils.ImageHelper)1 File (java.io.File)1