View Single Post
Posts: 6 | Thanked: 18 times | Joined on Mar 2012 @ Germany
#3110
Hi,

I found another bug with image resizing:
If you send a screenshot (480x854), it will get enlarged to 600x1067, looking blurry and taking more bandwidth than necessary.

To fix this, change line 153 in client/wamediahandler.py from:
Code:
elif user_img.height() > 600:
to:
Code:
elif user_img.height() == user_img.width() and user_img.height() > 600:
---
Explanation:

The prevoius code was
Code:
if user_img.height() > user_img.width() and user_img.width() > 600:
  preimg = user_img.scaledToWidth(600, Qt.SmoothTransformation)
elif user_img.height() < user_img.width() and user_img.height() > 800:
  preimg = user_img.scaledToHeight(800, Qt.SmoothTransformation)
elif user_img.height() > 600:
  preimg = user_img.scaled(600, 600, Qt.KeepAspectRatioByExpanding, Qt.SmoothTransformation)
So a portrait image slimmer than 600px but taller than 800px slipped through the first two conditions and accidentally was treated as square image.
 

The Following 8 Users Say Thank You to fpe For This Useful Post: