aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index d42b33c4a..5ade8a53d 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -301,16 +301,16 @@ public class ConversationFragment extends Fragment {
viewHolder.image.setVisibility(View.VISIBLE);
String[] params = item.getBody().split(",");
if (params.length==3) {
- int target = (int) (metrics.density * 288);
+ double target = metrics.density * 288;
int w = Integer.parseInt(params[1]);
int h = Integer.parseInt(params[2]);
int scalledW;
int scalledH;
if (w <= h) {
scalledW = (int) (w / ((double) h / target));
- scalledH = target;
+ scalledH = (int) target;
} else {
- scalledW = target;
+ scalledW = (int) target;
scalledH = (int) (h / ((double) w / target));
}
viewHolder.image.setLayoutParams(new LinearLayout.LayoutParams(scalledW, scalledH));