klinker24 / talon-for-twitter-android

The most powerful and beautiful Twitter client available.
https://klinkerapps.com/talon-overview
1.19k stars 183 forks source link

"Save image" doesn't save original file, but a recompressed one. #105

Open fireattack opened 6 years ago

fireattack commented 6 years ago

Repro

  1. Open https://twitter.com/ikenaikoto/status/1056870548469436417
  2. Save original size image from web, it is https://pbs.twimg.com/media/DqrCJkkUwAApxT5.jpg?name=orig

The size of the image 1.03MB, with 85% jpeg quality (as how Twitter images normally are)

  1. Open the same tweet in app, and download image.

The saved image is a 100% quality, 2.95 MB JPEG.

It is re-compressed from the above original image, bumped up the file size (because higher q) and obviously won't improve quality.

klinker24 commented 6 years ago

I am not recompressing anything. By default, Twitter provides a "large" style image. This is not the image that I use to download, I download their "orig" size image

https://github.com/klinker24/talon-for-twitter-android/blob/master/app/src/main/java/com/klinker/android/twitter_l/activities/media_viewer/image/ImageFragment.kt#L147

On the example you tweeted at me, it was 330kb for the "large" and 1.1mb for the "orig". I will download at whatever encoding and quality twitter provides for their "orig" size of images.

fireattack commented 6 years ago

Did you even read my description?

The problem is it doesn't just download the original, it downloads and reencodes/resaves it.

I already showed you that the file downloaded by Talon is NOT the same as the "orig" (or "large") file provided by Twitter.

klinker24 commented 6 years ago

I linked you to the code, feel free to let me know where it is being recompressed or changed from the orig size.

I did read your description and replied accordingly, with the insight I had, that you made no mention of. There is no need to be rude to me.

fireattack commented 6 years ago

This is the one saved by official Twitter app:

image

It has the same size as the web "orig" one, ~1.1 MB (yourself said so).

This is the one saved by Talon:

image

It has ~3MB because it was reencoded with q=100 JPEG.

If you need more "proof", I can show you, but let's be honest, the steps in OP is more than enough to show the bug if you actually tried.

If you don't mind a little bit rant, it is really infuriating when I wasted 30 min of sleep time and 2.99 dollar (I don't personally use Talon, a friend of mine told me about this bug), just because I want to be generous and help an OSS project, but you don't seem even to bother to try the STR.

I linked you to the code

Yes, the code shows that it should work that way, but it actually doesn't, on multiple devices.

Let me ask again: did you even try to download the image I linked with Talon, and observe its file size?

fireattack commented 6 years ago

I tried to read the code again (I don't understand Java or Android development myself, sorry), it seems you created a Bitmap object first from stream using BitmapFactory, then re-created a jpeg file with it using IOUtils.saveImage.

From my understanding this is exactly what will cause the re-encoding problem if you convert the file to bitmap first; but again, it's up to your discretion to analyze.

klinker24 commented 6 years ago

I do not need your rant and there is no room for a rant like that when you are choosing to contribute to an open source project. You didn't even need to buy the app, since you could have built it pretty easily yourself. I misunderstood your original report, nothing more than that. I was providing the information revelant that it seemed you had overlooked, since you made no mention of it at all.

I did in fact go to the Twitter website and download the image, which is clear since I specifically mentioned that it downloaded at 330kb. Seeing as that figure was nowhere in your report, it follows that this sizing information is a piece of information that you overlooked.

Thank you for the report, and again, there is no reason to be rude to me. I have not been rude to you.

fireattack commented 6 years ago

What exact part of the info that I didn't mention? The STR is pretty clear to me.

I personally don't think it is "not rude" to reporters if full steps to reproduce are given but the dev didn't try before closing the issue.

klinker24 commented 6 years ago

I did in fact go to the Twitter website and download the image, which is clear since I specifically mentioned that it downloaded at 330kb. Seeing as that figure was nowhere in your report, it follows that this sizing information is a piece of information that you overlooked.

fireattack commented 6 years ago

I have said "Save ORIGINAL size image from web", and provided you the ":orig" link in OP, didn't I? Did you in fact, go to Talon and download the image? This is the part I figured you didn't try.

klinker24 commented 6 years ago

I did, and as I said, I misunderstood your report. I opened the image and downloaded what was on the page, not the image link that you provided in step two. There was a clear discrepancy in the information I gleaned from the steps I took, from what you provided - there was no reason to have step one when you are not using the information for anything.

There is no reason to argue with me about it. I already re-opened the issue and admitted I misunderstood. I don't understand why you continue to come at me as you are. A simple "thank you" would suffice, otherwise, I am going to lock this issue, because I really do not feel the need to continue discussing it, nor do I understand why you are continuing to berate me.

fireattack commented 6 years ago

I apologize for being obnoxious.

I just wish you understand, while you keep saying you're "not rude" (which you legitimately feel so), but in my feeling it was not the case.

klinker24 commented 6 years ago

I do not feel as though it was at all rude for me to close the issue, when it is very apparent that I misunderstood. Now that you understand that as well, you undoubtably agree that my actions were not rude and that I was simply providing the information I felt was required to answer your questions. A misunderstanding is just that.

Enjoy your day.