Closed mnalis closed 7 months ago
Thanks for reporting! Strangely it works for me on Android 14 / Pixel 7:
It actually seems to work fine for me too. I tried using Simple Gallery app and the Google Photos app on a OnePlus Nord running Android 12.
@mnalis could you elaborate a bit on what app you use in order to share the image?
It was the stock EMUI12 Gallery app. But I can reproduce it by sharing from other apps, like CameraRoll too.
What is notable is that in step 3.
image is always successfully shown in Commons app, it is only when Edit is pressed when it is not -- so I would guess the picture always reaches the Commons app correctly, so the source app from which it was shared should not be important?
However, I see now that it works with some pictures (0:16
in video below), but not others (0:05
). Both pictures were originally taken with same app (OpenCamera). One difference seems to be the size - the working one is about 6MB, the non-working one 14MB. The other is portrait/landscape orientation.
Here is the video of app both working and not working depending on the picture:
And links to pictures (Too big to attach in issue directly):
Interesting, the edit feature might be failing due to some memory issue. Would you mind taking and posting a logcat?
Interesting, the edit feature might be failing due to some memory issue.
Oh, so may I assume that the same picture which is failing to edit for me is working for you normally then?
Would you mind taking and posting a logcat?
Sure, here it goes (after I shared the image and clicked on Edit
which didn't show the image, I backed out to android and then entered the app again and did Settings
/ Send log file
, and sending all logs done today. Hopefully that is good procedure?):
2023-11-29 16:26:17,327 [DEBUG] [file-logging-thread-1] [UploadModel] : File created date is 1700144602771
2023-11-29 16:26:17,329 [DEBUG] [file-logging-thread-1] [FileMetadataUtils] : Retuning tags for pref:Author
2023-11-29 16:26:17,329 [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: Artist
2023-11-29 16:26:17,329 [DEBUG] [file-logging-thread-1] [FileProcessor] : Exif tag Artist with value /mn/ OpenCamera wide my fork redacted.
2023-11-29 16:26:17,329 [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: CameraOwnerName
2023-11-29 16:26:17,329 [DEBUG] [file-logging-thread-1] [FileMetadataUtils] : Retuning tags for pref:Copyright
2023-11-29 16:26:17,330 [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: Copyright
2023-11-29 16:26:17,330 [DEBUG] [file-logging-thread-1] [FileMetadataUtils] : Retuning tags for pref:Serial Numbers
2023-11-29 16:26:17,330 [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: BodySerialNumber
2023-11-29 16:26:17,330 [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: LensSerialNumber
2023-11-29 16:26:17,393 [DEBUG] [file-logging-thread-1] [FileProcessor] : Calling GPSExtractor
2023-11-29 16:26:17,394 [DEBUG] [file-logging-thread-1] [ImageCoordinates] : EXIF data has location info
2023-11-29 16:26:17,396 [DEBUG] [file-logging-thread-1] [CategoryApi] : URL: https://commons.wikimedia.org/w/api.php?action=query&prop=categories%7Ccoordinates%7Cpageprops&format=json&clshow=%21hidden&coprop=type%7Cname%7Cdim%7Ccountry%7Cregion%7Cglobe&codistancefrompoint=45.80415725694444%7C15.953288078055555&generator=geosearch&ggscoord=45.80415725694444%7C15.953288078055555&ggsradius=10000&ggslimit=10&ggsnamespace=6&ggsprop=type%7Cname%7Cdim%7Ccountry%7Cregion%7Cglobe&ggsprimary=all&formatversion=2
2023-11-29 16:26:17,396 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.1
2023-11-29 16:26:17,396 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:17,409 [DEBUG] [file-logging-thread-1] [MediaLicenseFragment] : Position: 4 Attribution-ShareAlike 4.0
2023-11-29 16:26:18,023 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.1
2023-11-29 16:26:18,023 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:18,029 [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:fr.free.nrw.commons.ui.PasteSensitiveTextInputEditText{5734477 VFED..CL. ......I. 0,0-0,0 #7f0900e5 app:id/description_item_edit_text}
2023-11-29 16:26:18,029 [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2023-11-29 16:26:18,084 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,085 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,086 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,087 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,087 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,087 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,088 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,090 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,091 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,092 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,092 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,093 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,093 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,093 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,093 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,094 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,094 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,094 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,094 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,095 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:18,095 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,025 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,026 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,026 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,026 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,027 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,027 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,028 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,028 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,029 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,029 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,029 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,030 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,030 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,031 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,031 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,032 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,032 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,032 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,033 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,033 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,034 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,034 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,035 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,035 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,035 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,036 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,036 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,037 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,037 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,038 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,038 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,038 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,039 [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2022
2023-11-29 16:26:19,074 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.2
2023-11-29 16:26:19,074 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:19,335 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.3
2023-11-29 16:26:19,335 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:20,182 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.4
2023-11-29 16:26:20,182 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:38,023 [DEBUG] [file-logging-thread-1] [ContributionsFragment] : Number of notifications is 18
2023-11-29 16:26:38,935 [DEBUG] [file-logging-thread-1] [LocationServiceManager] : on location changed
2023-11-29 16:26:38,935 [DEBUG] [file-logging-thread-1] [NearbyController] : Loading attractions near lat/lng: (45.8XXXXXX,15.9XXXXXX)
2023-11-29 16:26:38,936 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.3
2023-11-29 16:26:38,936 [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2023-11-29 16:26:39,496 [DEBUG] [file-logging-thread-1] [NearbyPlaces] : 1 results at radius: 0.300000
2023-11-29 16:26:39,497 [DEBUG] [file-logging-thread-1] [NearbyController] : Sorting places by distance...
2023-11-29 16:26:39,497 [DEBUG] [file-logging-thread-1] [NearbyNotificationCardView] : Update nearby card notification content
2023-11-29 16:26:39,767 [DEBUG] [file-logging-thread-1] [LocationServiceManager] : on location changed
Also, there is a mistake in original report, sorry about that, I've sticken-out incorrect part now.
I.e. bug happens even when I open the picture via +
icon in the app, exactly in the same way as when shared via external app. (It seems when initially testing I have not tried the same picture for sharing and +
but different ones, and as luck would have it some pictures work and some don't.)
It gets more and more interesting:
edit
, even if at 5.6MB
it is smaller than https://mnalis.com/tmp/IMG_20231116_133606.jpg which shows correctly at 6.3M
.Another idea was that maybe landscape pictures fail, but portrait ones work, but that also seems not to be the case: e.g. this https://mnalis.com/tmp/IMG_20231123_151953.jpg is in portrait mode, but fails to show in edit
.
While this one in landscape https://mnalis.com/tmp/IMG_20231030_210533.jpg works.
To summarize:
Image | size | pixels | status |
---|---|---|---|
IMG_20231116_161908.jpg | 5.6 M | 7296 x 5472 | FAILS |
IMG_20231116_133606.jpg | 6.3 M | 5120 x 3840 | works |
IMG_20231030_210533.jpg | 7.0 M | 5120 x 3840 | works |
IMG_20231123_151953.jpg | 12 M | 5472 x 7296 | FAILS |
IMG_20231116_142322.jpg | 14 M | 5472 x 7296 | FAILS |
Pictures that fail always fail, and those which work always work, even when tried several times in random orders.
Can someone confirm if they can reproduce the problem with those which fail?
Sorry I had not actually tried when I wrote my last comment.
Now I tried to upload some of the various pictures you kindly provided, and can indeed see crashes (using the standard picker, I have not tried other methods such as share), for instance this one with https://mnalis.com/tmp/IMG_20231116_161908.jpg :
java.lang.RuntimeException: Canvas: trying to draw too large(159694848bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:94) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:549) at android.widget.ImageView.onDraw(ImageView.java:1446) at android.view.View.draw(View.java:23900) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.updateDisplayListIfDirty(View.java:22758) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.updateDisplayListIfDirty(View.java:22758) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.updateDisplayListIfDirty(View.java:22758) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.updateDisplayListIfDirty(View.java:22758) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.updateDisplayListIfDirty(View.java:22758) at android.view.View.draw(View.java:23631) at android.view.ViewGroup.drawChild(ViewGroup.java:4559) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4320) at android.view.View.draw(View.java:23903) at com.android.internal.policy.DecorView.draw(DecorView.java:809) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5144) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4835) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4011) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2650) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9526) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1343) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1352) at android.view.Choreographer.doCallbacks(Choreographer.java:952) at android.view.Choreographer.doFrame(Choreographer.java:882) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1326) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8194) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
The message trying to draw too large [...] bitmap
seems to come from an upstream library: https://stackoverflow.com/questions/40835514/android-canvas-drawing-too-large-bitmap
java.lang.RuntimeException: Canvas: trying to draw too large(159694848bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
Thanks for verifying!
As a side note, it is interesting that those error messages didn't appear to show in my Settings
/ Send log file
. Should it have been logged there? (i.e. should I file another bug that?)
should I file another bug that?
Yes if there is none yet, thanks!
This is an interesting bug, i will try finding a fix!
Did you perhaps have a chance to take a look at it, @shankarpriyank ?
Hi @mnalis I was able to reproduce the bug, i have still not had the chance to spend some time fixing it, but it's on my todo list and should be done by this weekend
@mnalis The issue seems fixed, please try on more examples and let us know if the issue is still present. :-) I uploaded https://commons.wikimedia.org/wiki/File:Building_and_cars_in_Croatia.jpg as a test, you may want to fix its metadata. 😅
Summary
When image is shared to Commons app via Android built-in share functionality, the
Edit
button does not show image (and thus is useless) for many (but not all) of them. It is reproducible, i.e. pictures that fail always fail, and those which work always work.However, the image is normally shown inEdit
(and can be rotated) if it has been opened from app (via+
icon and the picture icon)Steps to reproduce
share
icon and chooseUpload to Commons
Step 1/4: Media details
opens normally with picture correctly shown in the backgroundEdit image
buttonExpected behaviour
picture should be shown, along with
rotate
/save
buttonsActual behaviour
only
rotate
/save
buttons are shown, with rest of the screen being whiteDevice name
Huawei P30Pro
Android version
Android 10 (EMUI 12)
Commons app version
4.2.1 ~14b6c455b (latest f-droid)
Device logs
No response
Screen-shots
Would you like to work on the issue?
None