No preview nor caption/description fields when uploading Nearby place whose EXIF geolocation is far from the place
https://github.com/user-attachments/assets/caaa7565-2122-41d8-ba8b-f8e4a487b0ce
or rather it took a minute or so. And then failed to link from Wikidata.
Just happened to me once so might be difficult to reproduce.
Hi, could I be assigned this issue?
Hi, I've been digging around at this for a bit and I believe I have an Idea of what is causing the bug but after some time trying to get started on a solution, it seems quite out of scope for me, especially since this is my first issue in this repo. While I haven’t managed to recreate the bug, I believe it is caused by a memory leak related to the EXIF tag.
What I've found so far is that when an image is uploaded through nearby, the EXIF location data is used in addition to the selected nearby place. As seen below, an image from Australia was uploaded to a tokyo station place and then depictions from both were loaded.
I’ve also found that some of the places loaded for this seem to persist, which can be seen when uploading a second image with a far away EXIF location. As seen in the image below, there are depictions for the Tokyo station where the upload is occurring, America where the image being uploaded is from and australia, where an image that had been uploaded prior was taken,
In addition to this, the LeakCanary Android studio has been consistently going off whenever I upload an image with an EXIF tag far away using nearby, though this might just be because I’m using an emulator. HEAP ANALYSIS RESULT ==================================== 1 APPLICATION LEAKS
References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.
50831287 bytes retained by leaking objects
Signature: 85d2cf3ca7b7a2c5181f50fca964a4c0514c0635
┬───
│ GC Root: Input or output parameters in native code
│
├─ dalvik.system.PathClassLoader instance
│ Leaking: NO (ThumbnailsAdapter↓ is not leaking and A ClassLoader is never leaking)
│ ↓ ClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│ Leaking: NO (ThumbnailsAdapter↓ is not leaking)
│ ↓ Object[3583]
├─ fr.free.nrw.commons.upload.ThumbnailsAdapter class
│ Leaking: NO (a class is never leaking)
│ ↓ static ThumbnailsAdapter.context
│ ~~~~~~~
╰→ fr.free.nrw.commons.upload.UploadActivity instance
Leaking: YES (ObjectWatcher was watching this because fr.free.nrw.commons.upload.UploadActivity received
Activity#onDestroy() callback and Activity#mDestroyed is true)
Retaining 50.8 MB in 41900 objects
key = aaae9fe6-ca84-4f80-8fb8-6216858ca886
watchDurationMillis = 5835
retainedDurationMillis = 824
mApplication instance of fr.free.nrw.commons.CommonsApplication
mBase instance of androidx.appcompat.view.ContextThemeWrapper
” I was originally attempting to override where the upload used the EXIF data to generate the depictedItem list but I couldn’t work out where that was occurring and I believe the issue might be larger than just that.
@LachlanBraithwaite
it seems quite out of scope for me
Feel free to unassign yourself if you want. You are also very welcome to take another issue if you wish to. :-) Thanks!
I'll work on this issue.
I can't reproduce the issue. If anyone still sees it please reopen, thanks! 🙂