Search in sources :

Example 1 with SkiaImageRegionDecoder

use of com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder in project Signal-Android by signalapp.

the class AttachmentRegionDecoder method init.

@Override
public Point init(Context context, Uri uri) throws Exception {
    Log.w(TAG, "Init!");
    if (!PartAuthority.isLocalUri(uri)) {
        passthrough = new SkiaImageRegionDecoder();
        return passthrough.init(context, uri);
    }
    InputStream inputStream = PartAuthority.getAttachmentStream(context, uri);
    this.bitmapRegionDecoder = BitmapRegionDecoder.newInstance(inputStream, false);
    inputStream.close();
    return new Point(bitmapRegionDecoder.getWidth(), bitmapRegionDecoder.getHeight());
}
Also used : InputStream(java.io.InputStream) Point(android.graphics.Point) SkiaImageRegionDecoder(com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder)

Example 2 with SkiaImageRegionDecoder

use of com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder in project Signal-Android by WhisperSystems.

the class AttachmentRegionDecoder method init.

@Override
public Point init(Context context, Uri uri) throws Exception {
    Log.d(TAG, "Init!");
    if (!PartAuthority.isLocalUri(uri)) {
        passthrough = new SkiaImageRegionDecoder();
        return passthrough.init(context, uri);
    }
    InputStream inputStream = PartAuthority.getAttachmentStream(context, uri);
    this.bitmapRegionDecoder = BitmapRegionDecoder.newInstance(inputStream, false);
    inputStream.close();
    return new Point(bitmapRegionDecoder.getWidth(), bitmapRegionDecoder.getHeight());
}
Also used : InputStream(java.io.InputStream) Point(android.graphics.Point) SkiaImageRegionDecoder(com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder)

Aggregations

Point (android.graphics.Point)2 SkiaImageRegionDecoder (com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder)2 InputStream (java.io.InputStream)2