do not upscale images in headlines more than 2x
This commit is contained in:
parent
bbf4c65fac
commit
5685b91aa9
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="240"
|
||||
android:versionName="1.41" >
|
||||
android:versionCode="241"
|
||||
android:versionName="1.42" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
|
@ -20,6 +20,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
@ -163,6 +164,10 @@ public class EnlargingImageView extends android.widget.ImageView {
|
||||
// Try adjusting width to be proportional to height
|
||||
if (resizeWidth) {
|
||||
int newWidth = (int) (desiredAspect * (heightSize - ptop - pbottom)) + pleft + pright;
|
||||
|
||||
if (newWidth > 0 && widthSize > 0 && newWidth / widthSize > 2)
|
||||
newWidth = widthSize * 2;
|
||||
|
||||
if (/*newWidth <= widthSize &&*/ newWidth > 0) {
|
||||
widthSize = Math.min(newWidth, mMaxWidthL);
|
||||
heightSize = (int) ((widthSize - pleft - pright) / desiredAspect) + ptop + pbottom;
|
||||
@ -172,6 +177,10 @@ public class EnlargingImageView extends android.widget.ImageView {
|
||||
// Try adjusting height to be proportional to width
|
||||
if (resizeHeight) {
|
||||
int newHeight = (int) ((widthSize - pleft - pright) / desiredAspect) + ptop + pbottom;
|
||||
|
||||
if (newHeight > 0 && heightSize > 0 && newHeight / heightSize > 2)
|
||||
newHeight = heightSize * 2;
|
||||
|
||||
if (/* newHeight <= heightSize && */ newHeight > 0) {
|
||||
heightSize = Math.min(newHeight, mMaxHeightL);
|
||||
widthSize = (int) (desiredAspect * (heightSize - ptop - pbottom)) + pleft + pright;
|
||||
|
Loading…
Reference in New Issue
Block a user