-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: keep the format of imported images and remove 1MB limit #17014
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
4b9bf45
to
420b34d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue also applies to PNGs, Animated PNGs, WebPs, BMPs, AVIFs, and any format that isn't a JPG file.
It was introduced in #16798 when all the files started being converted to JPGs for no explicit reason.
Why the change from just importing the file as is? This only complicates things and create issues. Files shouldn't be compressed or converted without any warn
We only allow max 1 MB image size, camera images are greater than that on physical devices, so I placed it to compress the images by default, for images that are static it should not matter? |
420b34d
to
416df02
Compare
Now the compression won't take place by default but if the image is over 1MB then there will be an option to compress or crop it when user tries to save it, otherwise the original name and extension will be retained |
It breaks transparency, metadata, quality and makes it a lossy image, so it matters a lot. |
AnkiDroid/src/main/java/com/ichi2/anki/multimedia/MultimediaImageFragment.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimedia/MultimediaImageFragment.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/test/java/com/ichi2/anki/multimedia/MultimediaImageFragmentTest.kt
Outdated
Show resolved
Hide resolved
416df02
to
1df4b0c
Compare
1df4b0c
to
82d33e7
Compare
Given #17030, you can remove the 1MB limit and the compressing option in this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too far. A feature request from long ago when camera images were only 3MB was that a user would see that an image was large and have the option to crop and/or compress it --> #5629
This PR is the equivalent of "The feature you requested is now mandatory" which is not the way to go.
We should not compress all the time, no. But we should not remove the notice to users that the image is really large and they might consider cropping/compressing it.
Note that there is a 100MB per file limit, so there is a limit, even if it is quite large: https://faqs.ankiweb.net/are-there-limits-on-file-sizes-on-ankiweb.html
|
7facc53
to
c6e4935
Compare
@mikehardy waiting for your input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this in general
I left a nitpick + constructive suggestion on the comment related to the limit as it was outdated size and didn't have a reference to upstream source
I believe all these commits should be squashed and re-pushed as a single commit, since the code involved flaps from deleted to not deleted between commits, it only made sense to review as a single commit, should only be merged as a single commit
If the comment is updated and it's a single commit, I'm good with a merge
AnkiDroid/src/main/java/com/ichi2/anki/multimedia/MultimediaUtils.kt
Outdated
Show resolved
Hide resolved
fix: remove the 1MB limit for the images in AnkiDroid Follow the Anki convetions for image size see https://faqs.ankiweb.net/are-there-limits-on-file-sizes-on-ankiweb.html
c6e4935
to
fdfa0a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for plowing through this one
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
Purpose / Description
Gif was compressed and renamed with
jpg
extension this PR fixes the issueFixes
How Has This Been Tested?
Tested on Google emulator API 35
Checklist
Please, go through these checks before submitting the PR.