Fix scaling issue when loading emoji sprites

Fixes #5973
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-11-06 08:11:36 -08:00
parent 1c680a2c64
commit ad6ae10a41
3 changed files with 25 additions and 38 deletions

View File

@@ -15,6 +15,7 @@ import android.support.annotation.WorkerThread;
import android.util.Log;
import android.util.Pair;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy;
import org.thoughtcrime.securesms.mms.GlideApp;
@@ -108,22 +109,6 @@ public class BitmapUtil {
}
}
@WorkerThread
public static <T> Bitmap createScaledBitmap(Context context, T model, float scale)
throws BitmapDecodingException
{
try {
return GlideApp.with(context.getApplicationContext())
.asBitmap()
.load(model)
.sizeMultiplier(scale)
.submit()
.get();
} catch (InterruptedException | ExecutionException e) {
throw new BitmapDecodingException(e);
}
}
private static BitmapFactory.Options getImageDimensions(InputStream inputStream)
throws BitmapDecodingException
{